Step 1: The upgrade
Let’s get right to it. Here’s the first step in the upgrade process:
freebsd-update upgrade -r 9.0-RELEASE
Once all files have been fetched, you will be asked a number of questions about merging config-files. They all seemed reasonable to me, so I just answered ‘y’ to all of them, but it might differ for you. Make sure you read the diff before accepting it.
If you get the following error:
The update metadata is correctly signed, but failed an integrity check. Cowardly refusing to proceed any further.Then simply patch your freebsd-update using the following command (source):
sed -i ” -e ’s/=_/=%@_/’ /usr/sbin/freebsd-updateand then re-run the upgrade command again.
If that went fine, it’s time to update the actual system. To do that, run:
freebsd-update installOnce the update is done, reboot your system:
shutdown -r nowWhen it comes back up, make sure you run the install-again to install again to intall the userland updates:
Once you’ve run this, you’ll get the message:
Completing this upgrade requires removing old shared object files. Please rebuild all installed 3rd party software (e.g., programs installed from the ports tree) and then run “/usr/sbin/freebsd-update install” again to finish installing updates.This is of course a massive pain in the butt, but you need to do this nonetheless. Depending on how many packages from ports you have installed, this may take everything from a few minutes to a long time.
The easiest way to do this is to run portupgrade (if you don’t have portupgrade, install it from ‘sysutils/portupgrade’):
rm /var/db/pkg/pkgdb.db && pkgdb -Ffuv && portupgrade -afp
I added the ‘p’-flag, as this allows you to run ‘portupgrade -afP’ on other nodes (assuming you have a shared ports-tree) and just install the packages without having to re-compile them.
Finally, when you’ve done this, you can run (for the last time):