FreeBSD has two separate components that can be updated: the core OS with
freebsd-update and third party software with
Security updates for the core and most popular packages are listed here as they come out.
Updating the core with freebsd-update
The first step is to check for updates. With elevated privileges, run:
When the process is complete, run:
If any updates are available they’ll be installed. In many cases you’ll be prompted to restart the machine and run
freebsd-update again to complete the update.
Updating packages with pkg
If you’ve installed packages with
pkg, you update them with the same utility.
You can check for updates with a single command. Run:
If you’ve installed packages with the ports system, do not update them with pkg. Any compile time changes will be overwritten. Update them with portsnap and portmaster.
To prevent a package from being updated with pkg, run:
pkg lock packagename
Updating packages with portmaster and portsnap
If you’ve installed packages with the ports system, two utilities are used –
The first utility,
portsnap, will update the local copy of the ports tree. Just run:
After the process is completed, packages need to be scanned for and updated with
portmaster. Do this with:
After each package is updated you’ll be asked if you want to delete a backup of the old package. Unless you have a good reason not to, you should.