How to Upgrade to FreeBSD 13.0

Print This Post Print This Post

On December 13th, 2021, FreeBSD 13.0 was released. This is the first release of the 13.x branch, which has been in testing for quite some time.

Don’t worry if your system is still running on the 12.x branch – the FreeBSD organization estimates that it’ll be supported until June 30th 2024. However, FreeBSD 11.x is due to go end-of-life on September 30th, 2021. It’s important to upgrade from 11.x because the system is no longer receiving kernel security updates or bugfixes! FreeBSD is designed with security in mind but that doesn’t mean it’s immune to security holes. You can upgrade directly from 11.x or 12.x to 13.x using this guide. You may need to upgrade to an intermediate release if you’re running 10.x or older.

13.0 is a relatively minor update mainly containing updated components, support for additional hardware, and deprecation of older hardware. If you’re concerned that your hardware may no longer be supported you can check out the hardware compatibility list for this release. Read the full release notes here to see what’s changed. Also be sure to check out the errata which lists any issues that may be encountered while upgrading.

Ensure your system is backed up before upgrading!
Once you’re all set you can begin the upgrade process by logging in as root or typing su as a regular user to elevate. Simply run

freebsd-update -r 13.0-RELEASE upgrade

The updater will grab metadata from a FreeBSD update server and prepare for the upgrade. It will double check that it’s updating all of the components that are installed before proceeding.

Beginning the upgrade process from FreeBSD 12.x to 13.
Thousands of patches will then be downloaded. This can take a while depending on your internet connection speed.

If the error message “The update metadata is correctly signed, but failed an integrity check. Cowardly refusing to proceed any further” you need to finish some prior updates first. Do this by running:

freebsd-update fetch
freebsd-update install

A reboot may be required.

After all of the patches are downloaded the current configuration files will be checked against the defaults for the new version. Any differences will be displayed in a manner similar to performing a diff on a file. Check the differences to see if any changes will break something in the system.

The updater will then list all of the files being added, removed, and changed. You can either scroll through each screen to see the changes or hit the Q key to proceed to the next screen. When all changes have been displayed, you’ll be asked to run:

freebsd-update install

to apply the kernel patches. After a few minutes you’ll be asked to reboot the machine and run the same command to apply the userland patches.

Continuing the FreeBSD 11 upgrade

You may be asked to reboot a few times, re-running freebsd-update install each time. In addition, you may be told that software installed with pkg needs to be rebuilt. Go ahead and give the installer permission. It won’t take too long.

Finally you’ll be asked to rebuild any third-party software that have been installed from the ports system.

If you haven’t installed any software from the ports collection, you’re all done! Skip to the next heading.

If you need to rebuild third-party software, run:

portmaster -af

If portmaster is not found, you can install it easily by running:

pkg install portmaster

Depending on how many ports have been installed, the process can take a very long time. When it’s done, complete the upgrade process by running

freebsd-update install

for the final time.

Although it’s not required, you should reboot once more to make sure the system still comes up after the upgrade.

To make sure the upgrade was successful, run

freebsd-version

If the returned version starts with 13.0-RELEASE, you’re all set!

Make sure to keep the system patched going forward to ensure a happy and healthy FreeBSD install. You should also immediately update any software installed with pkg. Some may need to be upgraded to be compatible with 13.0.