How to upgrade FreeBSD 12 to 13

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"

On 13th April 2021, FreeBSD 13 had been released. If your system is still 12, and you want to get the benefit of this recent version, you will need to upgrade your current 12.

In this tutorial, the current version is 12.2.

$ freebsd-version

Fetch all available binary updates

Based on currently installed world and the configuration option set, we will run this command to fetch all available binary updates.

$ freebsd-update fetch

Next, install the recently fetched updates.

$ freebsd-update install

Now, we need to check if the new version and patch level had been applied. Command freebsd-version using option k will print the version and patch level of the installed kernel.

$ freebsd-version -k

Then we need to run freebsd-version using option r, which will print the version and patch level of the running kernel.

$ freebsd-version -r

We see that the result is not matched, so we need to reboot the system to apply the new kernel.

$ shutdown -r now

After a reboot, the result of the previously mentioned command will be the same. We can also use command uname using r option to confirm the version of the running kernel.

Upgrade to 13.0

We will run the command below to fetch files necessary for upgrading to a new release. This command will take several minutes to complete.

The freebsd-update will do assesment to the configuration files and will prompt you as follows for config file merging and other options as per your installed apps and customizations. Please read them carefully:

$ freebsd-update -r 13.0-RELEASE upgrade

Next, run the command as instructed to install the downloaded file and commit the changes to the disk.

$ /usr/sbin/freebsd-update install

Reboot the server.

$ shutdown -r now

Removing old shared libraries and object files

After the system back online, redo the freebsd-update session using the command below:

$ /usrb/sbin/freebsd-update install

Check the freebsd version.

$ freebsd-version

Now the FreeBSD version is already 13.0.

Upgrade Packages After Major Upgrades

Major versions use different Application Binary Interfaces (ABIs), which will break most third-party applications. If you use ports to build your third-party applications, you need to build all of those applications. If you use the package management system, then you can use the pkg-static command. The pkg-static is a statically linked variant of pkg typically only used for the initial installation of pkg. We will upgrade the pkg to the newer version.

$ pkg-static upgrade -f

$ pkg bootstrap -f

Since the package upgrades are already complete, we need to finalize the upgrade process by running this command below”

$ freebsd-update install

Reboot the server, once more.

Verify the Operating System details. We can use a nice tool named neofetch. Neofetch is a command-line system information tool written in bash 3.2+. Neofetch displays information about your operating system, software and hardware in an aesthetic and visually pleasing way.

Install the neofetch first.

$ pkg install neofetch

Next, run the neofetch.

$ neofetch

Congratulation, now you have upgraded to 13.0.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"
Unix/Linux Guru and FOSS supporter


Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook