Published : 2012-11-02

Migrate from 5.1 to 5.2

OpenBSD 5.2 was released on 1 November 2012. Here is a short guide to upgrade from OpenBSD 5.1 to 5.2. The practical example covers upgrading a redundant gateway using CARP (it could also be a load-balanced gateway).

The OpenBSD team advises against skipping many releases; follow the recommended upgrade path.

Estimated upgrade time (excluding third-party builds): 12 minutes

Step 1 — System upgrade

  1. Reboot the server from the OpenBSD 5.2 installation media.
  2. Choose Upgrade and set your keyboard layout.
  3. Select the disk containing your root filesystem and the root partition. fsck will be run.
  4. Agree to fsck on other partitions as needed—these may not have been checked in a long time.
  5. Proceed through installation and choose system packages to install; avoid X11 and games if you do not need them.
  6. Install and reboot.

Step 2 — Third-party packages

If you have third-party packages installed, update them after the base upgrade. Set PKG_PATH and run pkg_add -u:

export PKG_PATH=http://ftp.fr.openbsd.org/pub/OpenBSD/5.2/packages/amd64/
pkg_add -u

The command output will show packages being upgraded and removed as necessary.

Step 3 — Verification

As you can see, pkg_add asks you to review the configuration files it touched for your services. In this example, none of those changes required manual adjustments.

Step 4 — Local customizations

Finally, rebuild any third-party software that you compiled manually outside the packages system.

Additional advice

If you use CARP, remember to increase either the advskew value or carpdemote so that this server does not unexpectedly become master (ifconfig -g carp carpdemote 200).