The FreeBSD Diary
Providing practical examples since 1998If you buy from Amazon USA, please support us by using this link.
Upgrading to 3.3-STABLE 6 December 1999
I have a 3.3-RELEASE box which is destined to become an http/ftp server for a client
(see Installing an ftp server). That should go active
next week. But first I want to upgrade this box to 3.3-STABLE. This is how I
Note that I am doing a binary upgrade. You could achieve the same thing by using cvsup and then doing a make world. But this machine is a 486. That might take several days. This procedure took less than four hours elapsed.
Before you start this, you may want to install mergemaster first.
Do a backup
|If you don't do a backup right now, your upgrade will fail. Guaranteed. So
read Backing up FreeBSD onto a Windows NT Workstation for a
basic backup script.
You might also want to make a record of this information.
Know your encryption method - a tip
|You may not need to know this information right now, but you might need it one day.
Sometimes, when upgrading, people mess up their encryption. If you get asked what encryption method to use, make sure you specify the right one. Typically, systems use either MD5 or DES. Use http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/security.html to decide what you are using.
|In this upgrade, I'm going to the latest snapshot of stable. That happens to be
3.3-19991206-SNAP. So I do this:
I ran /stand/sysinstall
Select Options. Scroll down to Release Name and enter the snapshot you want. I entered 3.3-19991206-SNAP. Press Q to get back to the previous screen.
Read the Upgrading FreeBSD instructions. It may sound ominous. It is.
I always select the minimal distribution. You may wish to select another. I always do it this way, then add the other distributions later.
For the save, I accepted the default of /usr/tmp/etc
I was upgrading via FTP, so I entered the URL to my favorite snap shot server. See Official Mirrors for the server nearest you. Remember to enter the full path. e.g. ftp://ftp.nz.freebsd.org/pub/FreeBSD/snapshots/i386.
Once this finishes, don't exit sysinstall.
|I installed the new kernel source.
You should do that before you exit systinstall from the previous step. The easiest way to do this is by running /stand/sysinstall as root, choosing Configure, then Distributions, then src, then sys.
Similarly, I installed the man pages for this version. Why two steps? No reason.
|The next step is to merge the new file changes and the old file changes. This
sounds like a complex step. The first time you do this, it will seem complicated.
But it's pretty straight forward. What you are doing with mergemaster is comparing the BEFORE and AFTER images
of the system files. You take the ones you want and reject the ones you don't.
Basically, you want to take the bits which have been added by the upgrade process and keep
the bits you have added. Sometimes these two choice conflict but only you can decide
which is the best option. You have a backup. You can always refer to that.
When I ran mergemaster, I issued the following command:
mergemaster -rsv -t /etc/upgrade -w180 -s /etc
|After merging everything, I recompiled IP Filter.|
|The last step was to create a new kernel. For instructions on how to create a
new kernel, refer to the Configuring
the FreeBSD Kernel section in the FreeBSD
handbook. Pay special attention to the section on Building and Installing
a Custom Kernel.
After rebooting, here's what the system looks like:
# dmesg | head -5 Copyright (c) 1992-1999 FreeBSD Inc. Copyright (c) 1982, 1986, 1989, 1991, 1993 The Regents of the University of California. All rights reserved. FreeBSD 3.3-19991206-SNAP #0: Mon Dec 6 21:24:37 NZDT 1999 email@example.com:/usr/src/sys/compile/YOURKERNEL
And here's this too:
# uname -a FreeBSD yourbox.yourdomain.org 3.3-19991206-SNAP FreeBSD 3.3-19991206-SNAP #0: Mon Dec 6 21:24:37 NZDT 1999 firstname.lastname@example.org:/usr/src/sys/compile/SYNERGY i386
Note how 3.3-19991206-SNAP corresponds to the version I specified earlier during the install.
A few last notes
|You may have to upgrade other ports. If you suddenly find an application which no longer runs, and you have just upgraded your system, try recompiling the port. That should fix it.|
|Those of you that read the article the first time will have missed this bit. I
discovered a few hours after publishing that proftpd
was broken. Specifically, anonymous login worked, but regular users could not log
in. The error message was:
Dec 6 23:00:15 synergy proftpd: unable to resolve symbol: pam_sm_close_session Dec 6 23:00:16 synergy proftpd: PAM(dan): Authentication failure Dec 6 23:00:16 synergy proftpd: USER dan: incorrect password from yourbox.yourdomain.org [10.0.0.20] to 10.0.0.100:21
So I recompiled propftpd. But I needed to do more than that. See proftpd and FreeBSD