HYIP-Man: FreeBSD minor version upgrades
Thursday, January 03, 2008
FreeBSD minor version upgrades
freebsd
NOTE: Before proceeding, if you have FreeBSD Update scheduled to run from a cron job, disable the cron job! Bad Things will happen if FreeBSD Update tries to download security updates in the middle of this upgrade process.

These instructions apply only to minor version upgrades, e.g., from FreeBSD 6.something to FreeBSD 6.somethingelse, or from FreeBSD 7.something to FreeBSD 7.somethingelse. Upgrading from FreeBSD 6.x to FreeBSD 7.x is a more complicated process, and I will make another post soon to provide instructions on performing major version upgrades.


As I write this, "upgrade" support does not yet exist in the version of FreeBSD Update in the FreeBSD base system, so the first step is to download the script. If you are running FreeBSD 7.0-RC1 or FreeBSD 6.3-RC1 or later, you should already have this new version of FreeBSD Update installed, so you can skip this step.

# fetch http://www.daemonology.net/freebsd-update/freebsd-update-upgrade.tgz
freebsd-update-upgrade.tgz 100% of 21 kB 74 kBps
# fetch http://www.daemonology.net/freebsd-update/freebsd-update-upgrade.tgz.asc
freebsd-update-upgrade.tgz.asc 100% of 187 B 214 kBps
# gpg --verify freebsd-update-upgrade.tgz.asc freebsd-update-upgrade.tgz
gpg: WARNING: using insecure memory!
gpg: please see http://www.gnupg.org/faq.html for more information
gpg: Signature made Sat Nov 10 04:38:54 2007 PST using DSA key ID CA6CDFB2
gpg: Good signature from "FreeBSD Security Officer <security-officer@FreeBSD.org>"
# tar -xf freebsd-update-upgrade.tgz
I've signed the tarball containing this script; as Security Officer, I strongly recommend verifying the signature using gpg before proceeding.

When I run FreeBSD Update below, I invoke it as sh freebsd-update.sh -f freebsd-update.conf in order to use this new version of FreeBSD Update and its associated configuration file; if you skiped the above step because you're already running 7.0-RC1 or 6.3-RC1 or later, you can just invoke it as freebsd-update.

This system is presently running FreeBSD 6.2-RELEASE-p8, and I'm upgrading it to FreeBSD 6.3-BETA1; obviously, if you're reading this at some point in the future and want to upgrade to something other than FreeBSD 6.3-BETA1, you should change "6.3-BETA1" below and the output from the script will be correspondingly different.

# sh freebsd-update.sh -f freebsd-update.conf -r 6.3-BETA1 upgrade
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.
Inspecting system... done.

The following components of FreeBSD 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/base world/info world/lib32 world/manpages

The following components of FreeBSD do not seem to be installed:
kernel/generic world/catpages world/dict world/doc world/games
world/proflibs

Does this look reasonable (y/n)? y
Here FreeBSD Update is looking at the system and deciding which parts of FreeBSD you have installed -- obviously if you don't have the docs (documentation) from FreeBSD 6.2-RELEASE installed you aren't likely to want to have the docs from FreeBSD 6.3-BETA1 installed after upgrading.

Fetching metadata signature for 6.3-BETA1 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 5088 patches.....10....20 ... 5070....5080.... done.
Applying patches... done.
Fetching 550 files... done.

The following files will be removed as part of updating to 6.3-BETA1-p0:
/usr/share/examples/netgraph/bluetooth/rc.bluetooth
/usr/share/info/bzip2.info.gz
...
/var/named/etc/namedb/PROTO.localhost.rev
/var/named/etc/namedb/make-localhost

The following files will be added as part of updating to 6.3-BETA1-p0:
/boot/kernel/coretemp.ko
/boot/kernel/if_cxgb.ko
...
/var/named/etc/namedb/master/localhost-forward.db
/var/named/etc/namedb/master/localhost-reverse.db

The following files will be updated as part of updating to 6.3-BETA1-p0:
/COPYRIGHT
/bin/[
...
/usr/src/usr.sbin/wpa/wpa_supplicant/wpa_supplicant.conf.5
/var/named/etc/namedb/named.conf
FreeBSD Update has downloaded all of the files needed to upgrade to the new release. You probably don't want to read through all the thousands of files which are being removed, added, or updated, but the lists are printed (and piped through more(1)) just in case.

Assuming you're satisfied that FreeBSD Update has got things right, you can tell it to go ahead and install:

# sh freebsd-update.sh -f freebsd-update.conf install
Installing updates...
Kernel updates have been installed. Please reboot and run
"freebsd-update.sh install" again to finish installing updates.
When upgrading to a new FreeBSD release, it's important to make sure that you are running the new kernel before you install the new non-kernel components -- otherwise there's a chance of things breaking horribly when programs try to use features which the old kernel doesn't understand. When FreeBSD Update asks you to reboot before continuing, do what it says!
# shutdown -r now
After the system reboots, you can log in again and tell FreeBSD Update to finish the upgrade; and then finally reboot a second time so that you'll have the new versions of system daemons (e.g., sshd(8)) running:
# sh freebsd-update.sh -f freebsd-update.conf install
Installing updates... done.
# shutdown -r now
Finally, if you disabled a FreeBSD Update cron job before starting this process, don't forget to turn it back on.

All told, this upgrade took me about 15 minutes -- it's fast enough that there's really no excuse for not upgrading every time a new BETA or RC (release candidate) is released.

source:daemonology.net/blog/

Labels: