How To Upgrade FreeBSD 6.2 to FreeBSD 6.3 ( Minor Update ) using freebsd-update utility

Q. I’ve FreeBSD 6.2 p9 installed and I’d like to upgrade my box to latest FreeBSD 6.3 release using binary update method. How do I upgrade my box over an ssh session?

A. FreeBSD 6.3 has new updated tool called freebsd-update which supports binary upgrades of i386 and amd64 systems systems running earlier FreeBSD releases, release candidates, and betas. Users upgrading to FreeBSD 6.3 from older releases (in particular, older than 6.3-RC1) will need to download an updated version of freebsd-update(8) that supports upgrading to a new release.

WARNING! These examples may crash your FreeBSD computer if executed or interrupted over ssh session. Backup both data and configuration file before attempting these instructions.

Step # 1: Find out current FreeBSD version

$ uname -mrs
Output:

FreeBSD 6.2-RELEASE-p9 i386

Step # 2: Download updated freebsd-update

Download an updated version of freebsd-update utility that supports upgrading to a new release.

Download freebsd-update-upgrade package:
# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz
Download gpg key to verify package:
# fetch http://people.freebsd.org/~cperciva/freebsd-update-upgrade.tgz.asc
Verify package:
# gpg --verify freebsd-update-upgrade.tgz.asc freebsd-update-upgrade.tgz
Extract package:
# tar -xf freebsd-update-upgrade.tgz

Step #3: Start update procedure with freebsd-update

Start upgrade procedure and download all lates files / packages, enter:
# sh freebsd-update.sh -f freebsd-update.conf -r 6.3-RELEASE upgrade
Output:

Looking up update.FreeBSD.org mirrors... 1 mirrors found.
Fetching metadata signature for 6.2-RELEASE from update1.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata files... done.
Inspecting system... 
The following components of FreeBSD seem to be installed:
kernel/generic world/base world/dict world/doc world/manpages

The following components of FreeBSD do not seem to be installed:
kernel/smp src/base src/bin src/contrib src/crypto src/etc src/games
src/gnu src/include src/krb5 src/lib src/libexec src/release src/rescue
src/sbin src/secure src/share src/sys src/tools src/ubin src/usbin
world/catpages world/games world/info world/proflibs

Does this look reasonable (y/n)? y

Fetching metadata signature for 6.3-RELEASE from update1.FreeBSD.org... done.
Fetching metadata index... done.
Fetching 1 metadata patches. done.
Applying metadata patches... done.
Fetching 1 metadata files... done.
Inspecting system... 
done.
Preparing to download files... done.
Fetching 6150 patches.....10....20....30....40....50....60....70....80....90....100....110....120....130....140....150....160....170....180....190....200....210....220....230....240....250....260....270....280....290....300....310....320....330....340....350....360....370....380....390....400....410....420....430....440....450....460....470....480....490....500....510....520....530....540....550....560....570....580....590....600....610....620....630....640....650....660....670....680....690....700....710....720....730....740....750....760....770....780....790....800....810....820....830....840....850....860....870....880....890....900....910....920....930....940....950....960....970....980....990....1000....1010....1020....1030....1040....1050....1060....1070....1080....1090....1100....1110....1120....1130....1140....1150....1160....1170....1180....1190....1200....1210....1220....
.......
..
....
/bin/rcp
/bin/realpath
/bin/red
/bin/rm
/bin/rmail
/bin/rmdir
/bin/setfacl
/bin/sh

Install downloaded files:
# sh freebsd-update.sh -f freebsd-update.conf install
Output:

Installing updates...
Kernel updates have been installed.  Please reboot and run
"freebsd-update.sh install" again to finish installing updates.

Reboot the box:
# reboot

Step #4: Install userland updates

You also need to upgrade other userland packages:
# sh freebsd-update.sh -f freebsd-update.conf install
Output:

Installing updates...

Again reboot the box, enter:
# reboot

Step #5: Verify updates

Make sure there are no error reported on console or log files:
$ uname -mrs
Output:

FreeBSD 6.3-RELEASE i386

Step #6: Update applications / port tree

Finally, you may need to upgrade running application such as php, apache, openssh and others. Simply use portsnap and portmanager commands to update all installed packages:
# portsnap fetch extract
# pkg_version -vIL=

Now upgrade installed ports:
# portmanager -u
OR
# portupgrade -a

References:

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.