Richard Bucker

Upgrade OpenBSD 7.2

Posted at — Oct 27, 2022

Introduction

I used to name my OpenBSD machines with the OS version number but after a few version upgrades I’d lose track of what version was actually installed. Then I spent time changing the names which had a number of side effects as I was moving services around the network. Services like etcd make some sense but it’s more crap that can go wrong.

the more moving parts the more likely something will fail

On the whole these days I simply name the machines on an index with a prefix from the model number.

Let’s get back on track

Typically with every OpenBSD release there are instructions pertaining to automatic and manual upgrades. Generally sysupgrade downloads and copies an upgrade bootloader then downloads all the base packages. Once verified it reboots the host. The bootloader sees the upgrade bootloader and launches it instead of the normal boot loader. The upgrade bootloader then locates the core packages and installs them. Performs a sysmerge of all the config files. At this point you’re expected to validate the many config files etc and then reboot.

Test your upgrade

Now that you think the OS was upgrade… you should test. For example I’ll run a uname -r hoping to see the version number I’m expecting. In my most recent experience the update did not complete. I was running OpenBSD 7.1 trying to update to 7.2 but ever time I sys a sysupgrade I was stuck in the same version (7.1).

For some quirky reason OpenBSD upgrades assumes you are connected to the console … and I was upgrading remotely such that when the upgrade bootloader started running it did not complete the task. It reminded me of the observation of the test effecting the outcome. (this kinda makes sense because the OpenBSD Installer does not connect to the network during the install. It’s related to one of their default security claims.)

To get past this I connected a display to my machines. But this kinda sucked because (a) the upgrade process is pretty reliable (b) I have 8 machines to upgrade and if they were in a remote DC then I would be cold and hungry.

So connect a display or a null display and try again/

Packages

Once the OS boots up you need to update the extra packages.

doas pkg_add -Uu

It would be a good idea to reboot because some packages might already be running and you cannot be certain that they know what to do… but should.