It was a hectic few weeks in the lead-up to the Christmas shutdown period at our small hosting company, so this morning I was able to steal some time and get my own little fleet upgraded to FreeBSD 15! This included:
- Our homelab “production” bhyve/jail server
- Our homelab “Ruben tinkering” box and backup target
- My cloud VPS hosting this site
- Our cloud VPS hosting everything else
(My ex-Sophos router, Xen HP Microserver, and second-hand Raspberry Pi “cluster” now run NetBSD instead of FreeBSD, Alpine Linux, and Raspbian, so those will be upgraded and maintained in a separate post).
Those of you paying attention may have noticed I said “this morning I was able to”. This wasn’t just a passing remark: this was the quickest turnaround for a major release I think I’ve had in a…
It was a hectic few weeks in the lead-up to the Christmas shutdown period at our small hosting company, so this morning I was able to steal some time and get my own little fleet upgraded to FreeBSD 15! This included:
- Our homelab “production” bhyve/jail server
- Our homelab “Ruben tinkering” box and backup target
- My cloud VPS hosting this site
- Our cloud VPS hosting everything else
(My ex-Sophos router, Xen HP Microserver, and second-hand Raspberry Pi “cluster” now run NetBSD instead of FreeBSD, Alpine Linux, and Raspbian, so those will be upgraded and maintained in a separate post).
Those of you paying attention may have noticed I said “this morning I was able to”. This wasn’t just a passing remark: this was the quickest turnaround for a major release I think I’ve had in a while. A massive shoutout to the release team, you made the process smooth like butter.
Was that my first BTS reference here? FreeBTS? AAAAAAAAA!
Wait, that was the Spanish Flea again, welp. Anyway, this will also be the last freebsd-update(8) upgrade I expect to do as well, now that we have pkg-base. It’s served us very well over the years. With thanks to Colin Percival :).
Also, don’t forget: always consult the handbook, release announcements, and errata for any release upgrades. What follows is a recount of my experience, not formal documentation.
Preparing for the upgrade
Some of these steps may not be strictly necessary, but I’ve always followed them to reduce the chances of hitting edge cases, something that’s bad enough when the edge is a table and the case is my shin at 3 in the morning when a monitoring server or my thirst has awoken me.
I always make sure I’m running the latest packages and version of the branch the machine is on. For RELEASE prior to this upgrade, that was 14.3:
# uname -mrs
==> 14.3-RELEASE
# pkg upgrade
==> Your packages are up to date.
# fetch -qo - https://wttr.in/Sydney
==> [...] 37 °C
Yikes, 37!? Oh well, two out of three ain’t bad.
All your base are belong to… upgrade?
Now we can upgrade:
# freebsd-update -r 15.0-RELEASE upgrade
# freebsd-update install
# sync; sync; sync
# shudown -r now
Yes, running sync(8) once, let alone a few times, is entirely redundant. But I grew up running smartdrv.exe /C, so it still makes me feel better. If you get that reference, you were either a nineties kid or older too. Anyway, I’m delighted to see this creep up in other peoples’ blogs from time to time, which means I’m going to include it again as well.
Now we can run the final update:
# printf "%s\n" "Europe"
Wait, that’s the band that did the Final Countdown, not a final update. Wow, this post is all over the place again.
# freebsd-update install
Donezo!
# uname -mrs
==> FreeBSD 15.0-RELEASE amd64
Brown paper pkgs, tied up with string
Now we can upgrade packages. Again, I always run this command after a major release update, though it might not always be necessary:
# pkg bootstrap -f
It was here though that I encountered my first surprise, because I thought this system was set to download latest packages, not quarterly:
Bootstrapping pkg from \
pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/quarterly, \
please wait...
Then I remembered pkg-base, and how we have a new default package config. So I copied this across and updated to latest.
# cp /etc/pkg/FreeBSD.conf \
/usr/local/etc/pkg/repos/FreeBSD.conf
# sed -i '' 's/quarterly/latest/g' \
/usr/local/etc/pkg/repos/FreeBSD.conf
Now we can try upgrading again:
# pkg bootstrap -f
Looking better:
Bootstrapping pkg from \
pkg+https://pkg.FreeBSD.org/FreeBSD:15:amd64/latest, \
please wait...
And finishing off:
# pkg upgrade
Also looks good for upgrading our copy-on-write visualiser (cough):
Installed packages to be REINSTALLED:
cowsay: 3.04_3 [FreeBSD-ports] \
(ABI changed: 'FreeBSD:14:amd64' -> 'FreeBSD:15:amd64')
That’s better :).
Upgrading the jails
I treat my FreeBSD jails more like PV VMs (I come from Xen land) with their own fat system installs, ZFS datasets, and network interfaces. Storage is cheap, and it gives me ultimate flexibility.
Unlike VMs though, FreeBSD’s update tooling also has provisions for installing into jails without logging in which was nice. Because this box is running 14 as well, we no longer need to specify the version the jail is running to freebsd-update(8) either, which is nice.
In brief:
# JAIL="mizuno"
# freebsd-update -j $JAIL -r 15.0-RELEASE upgrade
# freebsd-update -j $JAIL install
# service jail restart $JAIL
# freebsd-update -j $JAIL install
# cp /jail/$JAIL/etc/pkg/FreeBSD.conf \
/jail/$JAIL/usr/local/etc/pkg/repos/FreeBSD.conf
# sed -i '' 's/quarterly/latest/g' \
/jail/$JAIL/usr/local/etc/pkg/repos/FreeBSD.conf
# pkg -j bootstrap -f
# pkg -j $JAIL upgrade
# freebsd-update -j $JAIL mizuno
Done!
Parting thoughts
I’ll let the machine tell it. With apologies to JP Mens who runs his Ansible without cowsay(1):
____________
< Went well! >
------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||