This upgrade is more tricky than the earlier "minor version" upgrades, since you have to be running a 6.0 kernel before you can install binaries for 6.0, and you have to replace everything which used 5.4 libraries before you can delete them safely.
What follows are the steps I used to upgrade my FreeBSD 5.4-RELEASE systems to FreeBSD 6.0-RELEASE.
N.B. I only install the "base" "dict", "doc", and "manpages" distributions here -- I don't want the "catpages", "games", "info", "ports", "proflibs", or "src" distributions. If you want a different set of distributions, change the lists in steps 7, 8, 12, 13, and 16.
N.B. #2 This will obviously result in a system which is running a GENERIC kernel. If you need support for hardware or kernel options which aren't in that kernel, follow the instructions in src/UPDATING to upgrade via source.
cd /usr/ports/security/freebsd-update && make install clean cp /usr/local/etc/freebsd-update.conf.sample /usr/local/etc/freebsd-update.conf cd /usr/ports/sysutils/portupgrade && make install clean
freebsd-update -v IDS | tail +8 | grep . > /root/base-modified
ee /root/base-modified(or use vi or any other text editor you have installed.)
cut -f 1 -d '$' /usr/local/freebsd-update/work/md5all | uniq | while read X; do if [ -f $X ]; then echo $X; fi; done | sort > /root/base-old
pw groupadd _dhcp -g 65 pw useradd _dhcp -u 65 -c "dhcp programs" -d /var/empty -s /usr/sbin/nologin echo "_dhcp: root" >> /etc/mail/aliases
fetch -o /usr/disc1.iso \ ftp://ftp.freebsd.org/pub/FreeBSD/ISO-IMAGES-i386/6.0/6.0-RELEASE-i386-disc1.iso md5 /usr/disc1.iso(the hash printed should be cfe3c1a2b4991edd6a294ca9b422b9d5.)
mdconfig -a -t vnode -f /usr/disc1.iso -u 9 mount -t cd9660 -o ro /dev/md9 /mnt
for dist in base dict doc manpages; do cat /mnt/6.0-RELEASE/${dist}/${dist}.?? > /usr/${dist}.tgz done
mkdir /usr/release for dist in base dict doc manpages; do tar -xpzf /usr/${dist}.tgz -I /root/base-modified -C /usr/release done
grep ^/etc /root/base-modified | while read f; do diff -u ${f} /usr/release${f} done | more
xargs chflags noschg < /root/base-old
tar -Uxpzf /usr/base.tgz -X /root/base-modified -C / /boot/ shutdown -r nowThe system will now be in an inconsistent state, running a 6.0 kernel together with a 5.4 userland. Programs which interact directly with kernel internals (w, ps, top, mdconfig, etc.) will not work!
for dist in base dict doc manpages; do /rescue/tar -Uxpzf /usr/${dist}.tgz -X /root/base-modified -C / done shutdown -r now
for dist in base dict doc manpages; do tar -tzf /usr/${dist}.tgz done | lam -s '/' - | sort -u - /root/base-modified > /root/base-new comm -13 /root/base-new /root/base-old | grep -v /lib/ | xargs rm
portupgrade -fR portupgrade
portupgrade -afIf you have any other compiled programs installed, you should also recompile them at this point.
comm -13 /root/base-new /root/base-old | grep /lib/ | xargs rm rm -r /usr/release rm /usr/disc1.iso rm /usr/base.tgz /usr/dict.tgz /usr/doc.tgz /usr/manpages.tgz rm /root/base-modified /root/base-old /root/base-new
cd /usr/ports/sysutils/portsnap && make deinstall rmdir /var/db/portsnap && mv /usr/local/portsnap /var/db/portsnap