I just finished upgrading my Thinkpad T42 to the latest OpenBSD 4.2-current snapshot and thought I should share my upgrade process. Over the past few releases of OpenBSD, the process has gotten steadily easier. Marc Espie has almost single handedly overhauled the ports system (here, here and here to cite a few examples) into a robust, easy to upgrade system. And I especially like the clear distinction between the system base and add-on packages.
And, at this point, it's only slightly more work to create a port for new software instead of running make install to just install something into /usr/local/foo. The whole system has seen improvements, but I only pick on ports and packages because they'd been traditionally been more difficult to upgrade (you used to have to remove all packages and install the new ones). Even with the new packaging enhancements, though, on a production server it's a good idea to spend time comparing old configuration options to new configuration options to make sure the new versions of your applications do what you expect.
So, from top to bottom (at 10,000 feet), here's my upgrade process:
- I download the newest snapshots from my favorite mirror.
- I enable ACPI in both the ramdisk kernel and my upgrade kernel. For example:
- config -ef bsd
- enable acpi
- I copy bsd.rd to / and reboot.
- I type bsd.rd at the "boot>" prompt and go through the "(U)pgrade" process almost choosing defaults the whole way through.
- Because I test and build a bunch of different ports, I want to remove the cruft, so:
- I run: (cd /var/db/pkg ; ls -1 > ~/pkgs)
- I then remove lines for all of the ports I want and run: for f in `cat ~/pkgs`; do sudo pkg_delete $f; done a couple times to remove packages I really don't want. Dependencies for the packages I DO want nicely give error messages and are not removed.
- Then I go through the arduous process of upgrading my installed packages. It's a tough series of commands to type: pkg_add -ui
- Now with config-less X, there's nothing in /etc/X11 that I modify, so I rm -Rf /etc/X11 and run: tar -xvzpf xetc42.tgz -C /
[Update 2007-08-18]: As Antoine Jacoutot (ajacoutot@) pointed out, I am stupidly deleting the beautiful OpenBSD artwork in this step. So either also untar xetc42.tgz into /tmp/foo when running mergemaster in the next step or also run tar -xvzpf xbase42.tgz ./etc -C / && tar -xvzpf xshare42.tgz ./etc -C /. Thanks Antoine.
- Then I prepare my mergemaster comparison directory: mkdir /tmp/foo ; sudo tar -xvzpf etc42.tgz -C /tmp/foo
- I make sure mergemaster is installed and run: mergemaster -i -r -t /tmp/foo ([Update 2007-08-18]: Antoine also suggested using the -i option to mergemaster to automatically install new files.)
- Then I reboot one last time and I'm off and running.
Not including the download of the installation sets, the whole process took less than 20 minutes and I was back in X. It took longer to write this post than to upgrade my laptop.