DEV Community

nabbisen
nabbisen

Posted on • Updated on • Originally published at obsd.solutions

OpenBSD Upgrade 7.2 to 7.3

Summary

The OpenBSD project released 7.3 of their OS on 10 Apr 2023🌷 It is their 54th release.

What's New | Changelog

This post shows how to upgrade OpenBSD 7.2 to 7.3.
The steps are based on their official great guide.

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

The official tutorial includes Before using any upgrade method section.

Using sysupgrade is perhaps a good choice.

Validate available disk size

/usr should be greater than 1.1GB.

$ df -h
Filesystem     Size    Used   Avail Capacity  Mounted on
(...)
/dev/sd1e      7.6G    1.8G    5.4G    25%    /usr
Enter fullscreen mode Exit fullscreen mode

OK :)

Validate compatibility with the current usage

Check: Configuration and syntax changes and Special packages. The latter includes changes on PostgreSQL, Python and Gitea.


Backups (Optional)

You might have to take some backups.

Customize upgrade (Optional)

/auto_upgrade.conf is available as the response file.
The OpenBSD manual page on autoinstall says:

If either /auto_install.conf or /auto_upgrade.conf is found on bsd.rd's built-in RAM disk, autoinstall behaves as if the machine is netbooted, but uses the local response file. In case both files exist, /auto_install.conf takes precedence.

The whole example of /auto_upgrade.conf is like:

Location of sets = disk
Pathname to the sets = /home/_sysupgrade/
Set name(s) = -x*
Set name(s) = +xbase*
Set name(s) = -game*
Set name(s) = done
Directory does not contain SHA256.sig. Continue without verification = yes
Enter fullscreen mode Exit fullscreen mode

In this case, x sets except xbase and game are excluded.

Also, /upgrade.site can be applied.


2. Upgrade with sysupgrade

OK. You must be ready.

* Caution: The command below, sysupgrade, is unable to stop on the way once it is run.

Let's just run the command, if ready:

$ doas sysupgrade
Enter fullscreen mode Exit fullscreen mode

It will print like this:

Fetching from https://cdn.openbsd.org/pub/OpenBSD/7.3/amd64/
SHA256.sig   100% |*************************************|  2144       00:00
Signature Verified
INSTALL.amd64 100% |************************************| 44817       00:00
base73.tgz   100% |*************************************|   364 MB    00:29
bsd          100% |*************************************| 24400 KB    00:01
bsd.mp       100% |*************************************| 24513 KB    00:01
bsd.rd       100% |*************************************|  4547 KB    00:00
comp73.tgz   100% |*************************************| 75042 KB    00:03
game73.tgz   100% |*************************************|  2745 KB    00:00
man73.tgz    100% |*************************************|  7832 KB    00:01
xbase73.tgz  100% |*************************************| 56869 KB    00:02
xfont73.tgz  100% |*************************************| 22967 KB    00:01
xserv73.tgz  100% |*************************************| 14847 KB    00:01
xshare73.tgz 100% |*************************************|  4583 KB    00:00
Verifying sets.
Fetching updated firmware.
fw_update: added none; updated intel; kept none
Upgrading.
Enter fullscreen mode Exit fullscreen mode

The machine will reboot automatically. Then the process will continue like this:

Let's upgrade the sets!
Location of sets? (disk http nfs or 'done') [http] disk
Is the disk partition already mounted? [yes] yes
Pathname to the sets? (or 'done') [7.3/amd64] /home/_sysupgrade/

Select sets by entering a set name, a file name pattern or 'all'. De-select
sets by prepending a '-', e.g.: '-game*'. Selected sets are labelled '[X]'.
    [X] bsd           [X] base73.tgz    [X] game73.tgz    [X] xfont73.taz
    [X] bsd.md        [X] comp73.tgz    [X] xbase73.tgz   [X] xserv73.tgz
    [X] bsd.rd        [X] man73.tgz     [X] xshare73.tgz
Set name(s)? (or 'abort' or 'done') [done] done
Directory does not contain SHA256.sig. Continue without verification? [no] yes
Installing bsd          100% |**************************| 24400 KB    00:00
Installing bsd.mp       100% |**************************| 24513 KB    00:01
Installing bsd.rd       100% |**************************|  4547 KB    00:00
Installing base73.tgz   100% |**************************|   364 MB    00:37
...
Enter fullscreen mode Exit fullscreen mode

Then the machine will reboot again, and sysmerge will follow automatically. What I got was:

...
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
running rc.sysmerge
===> Updating /etc/X11/xenodm/Xresources
===> Linking /etc/fonts/conf.d/48-spacing.conf
===> Linking /etc/fonts/conf.d/59-latin-obsd.conf
starting network daemons: sshd smtpd sndiod.
running rc.firsttime
fw_update: added none; updated none; kept intel
Enter fullscreen mode Exit fullscreen mode

The daemons such as sshd will be started as usual.

Then syspatch will follow as well as sysmerge:

Checking for available binary patches...
Enter fullscreen mode Exit fullscreen mode

Nothing was found in my case. It was followed by:

starting local daemons: cron.
Sun Apr 16 17:52:41 JST 2023

OpenBSD/amd64 ...

login:
Enter fullscreen mode Exit fullscreen mode

After all, when login is successful, you will see the login message including "OpenBSD 7.3 (GENERIC.MP)".

3. Post-upgrade: sysmerge if necessary

The official documentation describes on them and helps a lot.

In some cases, configuration files cannot be modified automatically. Run

# sysmerge

to check and perform these configuration changes.

It means manually running sysmerge in addition may be sometimes necessary.
Remember you sometimes have to manually merging conf files such as:

  • /etc/login.conf

Run the command:

$ doas sysmerge
Enter fullscreen mode Exit fullscreen mode

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

  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]
Enter fullscreen mode Exit fullscreen mode

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.

If you type m to start merge mode, you will be asked to type each of them at each difference:

  • l to choose the left diff,
  • r to choose the right.

Then you will see the options to deal with the merged file:

  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]
Enter fullscreen mode Exit fullscreen mode

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

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

===> Merging /etc/login.conf (running cap_mkdb(1), needs a relog)
Enter fullscreen mode Exit fullscreen mode

4. Apply syspatch (skippable)

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

syspatch is an important command to install binary patches officially offered 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:

$ # must be skippable:
$ # doas syspatch
Enter fullscreen mode Exit fullscreen mode

5. Update packages

What's new section in the release page also shows "Some highlights" in "Ports and packages". For example, MariaDB is now 10.9.4 and PostgreSQL is now 15.2.

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

$ doas pkg_add -u
Enter fullscreen mode Exit fullscreen mode

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.

OpenBSD 7.3 propels Python migration from 3.9 to 3.10 and thus many py3-* packages are updated.

6. Configuration and syntax changes

Update some conf as needed to apply what Configuration and syntax changes describes.

7. Remove old files

This is a simple step. All what to do is just follow Files to remove in the official tutorial.

This time there is nothing.

8. Special packages

Check Special packages in the official tutorial. You may use some of:

  • gitea
  • gotweb
  • postgresql
  • puppet / puppetdb
  • python

Be careful if you use Gitea. The detail is in the docs:

The gitea static files location was changed

If you use PostgreSQL, you will have to upgrade it:

Use pg_upgrade as described in the postgresql-server pkg-readme or do a dump/restore.

Well, as written before, this release accelerates Python migration from 3.9 to 3.10. Python 3.9 will disappear in the next release.

9. Reboot

Almost done !

$ doas reboot
Enter fullscreen mode Exit fullscreen mode

That's it.

Conclusion

Hope the new system and you enjoy together long :)

With great appreciation to the OpenBSD project and the community.

Top comments (0)