FreeBSD: How to upgrade FreeBSD to a more recent release


In this quick how-to we’ll see how to upgrade FreeBSD from an older version to a newer one. 

Disclaimer

Upgrading an Operating System is always a potentially dangerous task, so this tutorial is provided as is and the author is NOT responsible for any system corruption and/or data loss incurred by inaccurate execution, lack of backups and inconsistent upgrade behaviour. I have tested this process to the best of my abilities and on multiple VMs, but this is NOT a warranty that it will work on every installation and every condition.

So you’re warned! 🙂

Intro

FreeBSD upgrade process has improved a lot through the years, and now it seems to be stable, although if it doesn’t seem capable of performing upgrades beyond the “next release” from the actual release in use.

Before you start the upgrade

  • The upgrade process will require internet access, so ensure your BSD system has a stable internet access before you start.
  • The upgrade process can corrupt your BSD installation, therefore ensure you have backups BEFORE proceeding any further.
  • Before you attempt this procedure on a production system, I strongly recommend you try it on non sensitive VMs until you become very familiar with the process.

Prepare FreeBSD for system release upgrade

Login on your BSD console (I did it as root for convenience, if you don’t want to use root you can use a sudo enabled account).

1. Check your current version with:

# freebsd-version

# uname -mrs

An output like the following should make it clear that both kernel and distribution version agrees on the release you have:

11.1-RELEASE

FreeBSD 11.1-RELEASE amd64

2. Next, fetch the updates (and patches) available for our release using:

# freebsd-update fetch

Let this process go and wait until it displays all the patches been applied. If you want to see them all, you can scroll the screen using vi commands and to quit View, just type:

[esc]:q

During the previous process patches have been applied to a copy in a different directory, so our system is still “untouched”.

3. Now let’s apply all the fixes with:

# freebsd-update install

Let this process go, it may take a while depending on the system speed. At the end of the process It may ask to re-run freebsd-update install, if so, do it.

4. Now let’s upgrade packages with:

# pkg-static upgrade

5. Now reboot your FreeBSD system with:

# shutdown -r now

When this is done you are ready to upgrade FreeBSD to the newer major release (immediately after the one you have installed).

Upgrade FreeBSD RELEASE

To upgrade a FreeBSD release, we need to ensure we go gradually (this is my personal experience), so lets not try to go directly from (for example) 11.0-RELEASE to 13.0-RELEASE (aka let’s not skip releases upgrade in-between).

If we have 11.0-RELEASE installed, we should first upgrade to 12.0-RELEASE using the procedure below. Then repeat the procedure in the previous chapter and then repeat this one to get to 13.0-RELEASE (again this is in my experience!).

Ok, so, for example, if we have installed 11.X-release then we want 12.0-RELEASE, run the following command:

# freebsd-update -r 12.0-RELEASE upgrade

Let the process go, it may take a while depending on internet connection speed and system speed.

If it asks questions then we need to review them and answer with a Y (for yes) or an N (for no). So, grab a cup of coffee and follow the process.

When all is done then run the final step with:

# freebsd-update install

Let this process go, you may have to run freebsd-update install AGAIN at the end of it.

When it’s all completed, you should reboot your system with:

# shutdown -r now

When the system comes back, ssh or login on the console and upgrade the packages with:

# pkg-static upgrade -f

Wait the the process competes, it may take a while depending on the internet connection speed and your system speed.

When completed, we’re finally done!

Ok, that’s it for now, thanks for reading and I hope you’ve found some useful information here. If you enjoyed this post, please don’t forget to support my blog by:

  • Visiting my on-line hacking and engineering merchandise shop on redbubble.com by clicking here
  • Or you can also make a donation with the PayPal link in the column on your right
  • Or share this article

If you like my articles and want to keep getting informed on new ones you can follow me on on of those 21st Century thingies called FacebookTwitterInstagram or Pinterest

And as always if you have any questions please feel free to use the comments section below.

Thank you! 🙂

Leave a Reply or Ask a Question

This site uses Akismet to reduce spam. Learn how your comment data is processed.