This short tutorial by user tdrss will show you how to keep your FreeBSD system up to date, ensuring you are secure and protected from the latest bugs.
To keep your system working smoothly, OS manufacturers release patches and upgrades on a regular basis. The FreeBSD OS is no different; its benefactor, the FreeBSD Foundation ensures that OS updates are on a regular, scheduled basis. Additional installed software also may require updates to ensure smooth running code. These ports and packages are maintained in central repository to ensure easy dissemination to the widest audience.
What does this mean for you? A very easy and rapid way to keep your system up-to-date and in tip-top shape!
Step 1: Verify a few things.
Know which version of FreeBSD you are running. For this example, I am running FreeBSD 10.1 (as of this writing, this is the most current version). So I can expect only minor updates to the 10.1 code. If you were running 8.x or 9x, you would have to make minor OS updates (e.g. 9.1 to 9.2 or 8.2. to 8.3), before a major version update (e.g. 8.x to 9.x)
Ensure you have a steady internet connection. Updates are downloaded from the ‘net, so if your connection is spotty, the software will Time-Out, and you will have to accomplish the updates at a later time.
Step 2: Update OS files with freebsd-update
freebsd-update is a great tool. It can do many things to keep your OS running smoothly; updating your current OS, upgrading to the next minor/major versions, rolling-back to a “good” working version. For this task, we will just be getting minor OS updates and installing them.
Ensure you are running as superuser (“root”) on your system:
Lines of code will verify which version you are running, and download the applicable updates. If updates were downloaded, once the command returns to the prompt, type in:
Minor OS versions do not require a system reboot to install.
If no updates are required, the command response will tell you.
Step 3: Keep Ports Tree updated
The Ports Collection is a set of Makefiles, patches and descriptive texts stored in /usr/ports. Keeping the Ports Tree up-to-date is vital to keeping your installed code base current.
portsnap fetch update
Any downloaded updates will be automatically extracted and included in your current Ports Tree.