Ever need to upgrade FreeBSD to the next release? It’s not hard! We can compile kernels some other day. Today, we’re just going to do binaries. Quick and easy, FreeBSD is the best.
Go ahead and log in to your machine, elevate yourself up to root (or use sudo). Lets get this show on the road: freebsd-update fetch
freebsd-update fetch & freebsd-update install
freebsd-update fetch && freebsd-update install
This process is not hands off. So, you’ll need to accept a few prompts. Generally, this is the only time you’ll really have to reboot FreeBSD, if you’ve been treating it well. But, in this case, I don’t run into the need for that (heh).
Once the update tool finishes grabbing all of the patches and applying them. We’ll need to update the pkg tool. The pkg tools is used to maintain binary packages on the system. If you’re a sane person, you either use pkg or the ports tree. The sanest people build binary packages from ports and keep a local repository, but that’s for another article.
Upgrading Binary Packages on FreeBSD
This tool keeps things as simple as they can be. So, if you’re familiar with POSIX compliant systems, you’ll recognize this process. Let’s continue to upgrade FreeBSD 11 to FreeBSD 12.
Use the static pkg binary to update the tool and then all of the installed packages. Again, I’m just going to go ahead and bang it one in one line. Any time you see me use &&, you can safely break the command into two commands, if you want. It is two commands anyway, just on one line.
pkg-static upgrade pkg && pkg upgrade
Yeah, that’s a lot of packages. Let’s make sure we’re on the latest FreeBSD 11 release, which should be FreeBSD 11.3
Completing the Upgrade FreeBSD Process
Good. Now we can get back to upgrading the kernel to the next major release. Time’s running out for security updates for 11.3 and we don’t want to still be around, once it does. Back to the freebsd-update tool
freebsd-update upgrade -r 12.0-RELEASE
This one will take a while. It should inspect your system and ask you if you agree with what it has found, then it should go grab a matching FreeBSD 12 image to apply on top. Now we will need to reboot. But, take a walk, if you want, make a sandwich or whatever.
We’re almost done. We need to check some things and that’s about it after this. You can e-mail me if you want me to do any of these things for you. Please do not forget that. It’s how I put food on the table.
Next Time Don’t Wait So Long to Upgrade FreeBSD!
You guessed it! We’re going to go ahead and apply all of those, oh so many, packages. Run freebsd-update install
It goes fast than you’d think. And, since we’ve finished patching away from FreeBSD 12. We now need to reboot and finish the final details of this FreeBSD version upgrade.
Congratulations! See how easy that was? I really love FreeBSD!
Apparently it wants us to run freebsd-update install three times, this time. If you compiled packages from ports. You’ll absolutely need to do this. And, if you didn’t, you’ll want to do this anyway because it removes a bunch of file lint that you’d otherwise have to do yourself.
Either way, welcome to FreeBSD 12.0-RELEASE!
The hackers at Gray Hat Freelancing are here to help you with any project you have that’s IT related. Tell me what you want to do and I’ll tell you how I can help you achieve that end. Have a good one!