Create Dec 7 2009

FreeBSD-update


Colin Percival, currently a FreeBSD security officer, has written a most excellent tool called freebsd-update

Here's a snip from and link to the handbook
"Applying security patches is an important part of maintaining computer software, especially the operating system. For the longest time on FreeBSD this process was not an easy one. Patches had to be applied to the source code, the code rebuilt into binaries, and then the binaries had to be re-installed.

This is no longer the case as FreeBSD now includes a utility simply called freebsd-update. This utility provides two separate functions. First, it allows for binary security and errata updates to be applied to the FreeBSD base system without the build and install requirements. Second, the utility supports minor and major release upgrades."
http://www.freebsd.org/doc/en/books/handbook/updating-freebsdupdate.html

I recenty used it to go from FreeBSD 6.2 Release to FreeBSD 8.0 Release, in one hop !!!
Wow using the old "Canonical Way", this would have taken soooo long.

I put this page together to hang my notes and scripts

Perhaps it will help you?


I first recommend reading the release notes for the OS you plan to upgrade to
http://www.freebsd.org/releases/

Then go to the announcement page for this same OS, lets say 8.0R for example
http://www.freebsd.org/releases/8.0R/announce.html

You will see that moving to 8.0R depends on where you start.
You may need to apply an update to the freebsd-update script, so pay close attention

Here is a step-by-step process that worked for me, adjust to taste
It assumes portupgrade and/or portmaster is installed

Keep in mind the command "freebsd-update install" will be executed 3 times

fetch http://www.daemonology.net/freebsd-update/freebsd-update-upgrade.tgz
gunzip -c freebsd-update-upgrade.tgz | tar xvf -
mv freebsd-update.sh /usr/sbin/freebsd-update
mv freebsd-update.conf /etc
cp -rp /etc /etc.old
portsnap fetch
portsnap update
portupgrade -af
or
portmaster -af

freebsd-update -r 8.0-RELEASE upgrade
or
freebsd-update -r 7.2-RELEASE upgrade - (Takes about 75 minutes on a 3GHz machine)

freebsd-update install - (Takes about 8 minutes on a 3GHz machine)
Here's an output of the above command
Kernel updates have been installed.  Please reboot and run
"/usr/sbin/freebsd-update install" again to finish installing updates.

reboot
freebsd-update install
Here's an output of the above command
Installing updates...
Completing this upgrade requires removing old shared object files.
Please rebuild all installed 3rd party software (e.g., programs
installed from the ports tree) and then run "/usr/sbin/freebsd-update install"
again to finish installing updates.

portupgrade -f ruby
rm /var/db/pkg/pkgdb.db
portupgrade -f ruby18-bdb
rm /var/db/pkg/pkgdb.db /usr/ports/INDEX-*.db
portupgrade -af
or
portmaster -af

[Note portupgrades Ruby dependancy sometimes seems to go bust in here somewhere requiring manual deinstall/reinstall
I'll try to post the error and my fix if I get it again]

One last time !!
freebsd-update install

I like to clean things up with this
portsclean -CDLP

Fun wow



Home                 Back

If you find an error or wish to comment please let me know.