FreeBSD upgrade from 6.4 to 8.0

1 minute read

I’ve recently had reason to source upgrade a FreeBSD box from version 6.4 to 8.0. The safest way to do this is by upgrading first to version 7.2. Here are some basic instructions – they’re a bit abbreviated because I had the luxury of removing all installed packages on the machine and upgrading just the base OS, then reinstalling packages. I will soon be upgrading a production machine, and will either update this post or create a new one when I’m doing live port upgrades.

Here’s what I did.

  • Backup!
  • As noted above, I had the luxury of removing all packages, so first thing I did was remove them.
  • Update /usr/src to RELENG_7_2 – I used csup, which is part of the base OS
  • In /usr/src, run make buildworld; make buildkernel – in my case I have a custom kernel configuration, so I run buildkernel with the additional flag KERNCONF=[config]
  • Once built, install the kernel and OS – make installkernel ; make installworld – again, in my case I added the KERNCONF flag
  • Reboot
  • Run mergemaster, which upgrades all configuration files – be careful if you have any customized files, consult the documentation
  • Reboot
  • If you can, in /usr/src run make check-old and then make delete-old – this removes all obsoleted files from the old version of the OS, don’t do it until later if you have old packages still installed that depend on those files
  • Make sure your ports tree is updated – see portsnap
  • Reinstall the following packages and dependencies: sudo, ruby, portupgrade
  • If you are incautious, run portupgrade -af – if more cautious, upgrade each package in turn and test
  • Reboot and test
  • Repeat every step above after upgrading /usr/src to RELENG_8_0

Update: one thing I forgot earlier, the -F flag to mergemaster is very useful, it automatically updates any files where only the VCS Id tag is different, which saves a lot of mindless approving of files.