OpenBSD Upgrade 7.0 to 7.1

Table of contents

Summary Summary

The OpenBSD (opens in a new tab) project released 7.1 (opens in a new tab) of their OS on 21 Apr 2022✨ It was their 52nd release.

openbsd release


This post shows how to upgrade OpenBSD 7.0 to 7.1. The steps are based on their official great guide (opens in a new tab).

Tutorial Tutorial

Here is a step-by-step guide for the upgrade with a set of the commands to run.

🌊 🐡 🌊

1. Pre-upgrade: Validate and customize 1. Pre-upgrade: Validate and customize

The official tutorial includes Before using any upgrade method (opens in a new tab) section.

Using sysupgrade (opens in a new tab) is perhaps a good choice.

Validate available disk size Validate available disk size

/usr should be greater than 1.1GB.

console
$ df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
(...)
/dev/sd1x      2.9G    1.6G    1.2G    56%    /usr

Validate it’s compatible with the current usage Validate it’s compatible with the current usage

Check: Configuration and syntax changes (opens in a new tab) and Special packages (opens in a new tab).

Customize upgrade (optional) Customize upgrade (optional)

/auto_upgrade.conf (opens in a new tab) and /upgrade.site (opens in a new tab) are available.

2. Upgrade with sysupgrade 2. Upgrade with sysupgrade

No problem left? You might have to take some backups.

* Caution: It is unable to stop sysupgrade on the way once run.

Let’s just run the command, if ready:

console
$ doas sysupgrade

It will print like this:

console
Fetching from https://cdn.openbsd.org/pub/OpenBSD/7.1/amd64/
SHA256.sig   100% |***********************************************************|  2144       00:00    
Signature Verified
INSTALL.amd64 100% |**********************************************************| 43495       00:00    
base71.tgz   100% |***********************************************************|   330 MB    00:36    
bsd          100% |***********************************************************| 22339 KB    00:05    
bsd.mp       100% |***********************************************************| 22438 KB    00:06    
bsd.rd       100% |***********************************************************|  4498 KB    00:02    
comp71.tgz   100% |***********************************************************| 73366 KB    00:10    
game71.tgz   100% |***********************************************************|  2744 KB    00:01    
man71.tgz    100% |***********************************************************|  7601 KB    00:03    
xbase71.tgz  100% |***********************************************************| 55182 KB    00:08    
xfont71.tgz  100% |***********************************************************| 22965 KB    00:04    
xserv71.tgz  100% |***********************************************************| 20117 KB    00:05    
xshare71.tgz 100% |***********************************************************|  4544 KB    00:01    
Verifying sets.
Fetching updated firmware.
intel-firmware-20210608v0->20220207v0: ok
vmm-firmware-1.14.0->1.14.0p0: ok
Read shared items: ok
Upgrading.

The sysupgrade process reboots the machine automatically. The process will continue like this:

sysupgrade-upgrade-to-be-completed

Then the machine will be rebooted again, and sysmerge (opens in a new tab) will follow automatically. What I got was:

console
running rc.sysmerge
===> Updating /etc/changelist
===> Updating /etc/fbtab
===> Updating /etc/newsyslog.conf
===> Updating /etc/X11/xenodm/GiveConsole
===> Updating /etc/X11/xenodm/TakeConsole
===> Updating /etc/syslog.conf
===> Linking /etc/fonts/conf.d/10-hinting-slight.conf
===> Linking /etc/fonts/conf.d/11-lcdfilter-default.conf
===> Linking /etc/fonts/conf.d/45-generic.conf
===> Linking /etc/fonts/conf.d/60-generic.conf
--- /etc/login.conf unhandled, re-run sysmerge to merge the new version

The daemons such as sshd will be started as usual.

Then syspatch (opens in a new tab) will follow as well as sysmerge:

console
Checking for available binary patches...

Well, in my case, it failed:

syspatch: Error retrieving https://cdn.openbsd.org/pub/OpenBSD/syspatch/7.1/amd64/SHA256.sig: 404 Not Found

It seems because no patches on amd64 had been provided.

After all, you will see the login message including “OpenBSD 7.1 (GENERIC)”.

3. Post-upgrade: sysmerge if necessary 3. Post-upgrade: sysmerge if necessary

The official documentation describes on them (opens in a new tab) and helps a lot.

rc.sysmerge ran automatically in the previous process as shown. But running this command may be necessary. It sometimes requires manually merging conf files such as:

  • /etc/login.conf

Run the command:

console
$ doas sysmerge

You will view the diff results first. Then you will be asked:

console
  Use 'd' to delete the temporary ./etc/login.conf
  Use 'i' to install the temporary ./etc/login.conf
  Use 'm' to merge the temporary and installed versions
  Use 'v' to view the diff results again

  Default is to leave the temporary file to deal with by hand

How should I deal with this? [Leave it for later]

Each of the top 3 options work like:

  • d: to preserve the current file.
  • i: to overwrite it with the new file sysupgrade brought.
  • m: to merge them manually and interactively.

When you type m and start merge mode, you can type l to choose the left diff and r to choose the right.

After all the diffs are merged, you will be asked:

  Use 'e' to edit the merged file
  Use 'i' to install the merged file
  Use 'n' to view a diff between the merged and new files
  Use 'o' to view a diff between the old and merged files
  Use 'r' to re-do the merge
  Use 'v' to view the merged file
  Use 'x' to delete the merged file and go back to previous menu
  Default is to leave the temporary file to deal with by hand

===> How should I deal with the merged file? [Leave it for later]

If you type e, editor will run with the merged file.

If you type i, the merged file will be installed directly:

console
===> Merging /etc/login.conf (running cap_mkdb(1), needs a relog)

The next two tasks below are usual just in order to update the system, too.

4. Apply syspatch (skippable) 4. Apply syspatch (skippable)

syspatch is an important command to install binary patches officially provided by OpenBSD successively as found to be needed. Well, sysupgrade runs syspatch in the process. Therefore, it must not be necessary to run it manually here:

console
$ # must be skippable:
$ # doas syspatch

5. Update packages 5. Update packages

What’s new (opens in a new tab) section in the release page also shows “Some highlights” in “Ports and packages”. For example, PHP (opens in a new tab) 8.1 (opens in a new tab) was instroduced as well as 7.4 (opens in a new tab) and 8.0 (opens in a new tab) :)

This command will update all of the packages installed in the machine:

console
$ doas pkg_add -u

It will print a lot, but you should be careful to read, especially its tail, which may tell there are some important changes or tasks to do.

Besides, one of them was:

console
--- +python-2.7.18p7 -------------------
*** Python 2.7 is end-of-life and no longer receives security updates.

Thank you and farewell, Python (opens in a new tab) 2.7 (opens in a new tab)… ;)

6. Remove old files 6. Remove old files

This is a simple step. All what to do is just follow Files to remove (opens in a new tab) in the official tutorial. This time:

No files need to be cleaned up for this release.

No task. Sweet 🥳

7. Special packages 7. Special packages

Check Special packages (opens in a new tab) in the official tutorial. You may use some of:

  • lang/python
  • games/multimc

Besides, special notes on Python 3 are shown:

The default Python 3.x flavor has changed to Python 3.9.

…

Python 3.8 is planned to be removed prior to the 7.2 release.

8. Reboot 8. Reboot

Almost done!

console
$ doas reboot

That’s it. Hope the new system brings you another happiness :)


With great appreciation to the OpenBSD project and the community.

More on: Upgrade and maintain OpenBSD

OBSD Solutions

OBSD Solutions: OpenBSD consulting and support by Scqr, Reflerd Inc. (opens in a new tab)

Comments and feedback are welcome.