We are going to upgrade our FreeBSD system with the CVSup tutorial. The FreeBSD team unlike Linux develops the Kernel and World. They are separate parts but linked together. Good practice will tell you not to upgrade just the kernel but the entire system.
Let check to see what we are running:
host# uname -a
We are going to assume that you have the ports system installed. Ports is a system that was developed to make it easy to install all types of software. Think of it like the Windows Add/Remove idea with a twist. You can check by going to /usr and looking for a ports folder. If you don’t have anything in that folder you can download it here:
host# cd /usr
host# fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/ports/ports.tar.gz
host# tar -xzf ports.tar.gz
Now we will install cvsup.
host# /usr/ports/net/cvsup make && make install
What we need to do is get a configuration file and make the necessary changes before upgrading the system. We will get the example file and move it to the root level.
host# cp /usr/share/examples/cvsup/stable-supfile /stable-cvsup
You will need to edit the stable-cvsup file. Choose a local mirror to download the update. Now 2 problems can exist new code is available around 60 minutes after it has been committed so their are people who download about once a hour to get the latest code. Therefore the highest loads tend to be on the hour and you may have to hold till a server is free or you can switch the option in the file in the server is full. cvsup.freebsd.org tends to be the most busy of the servers for obvious reasons.
host# cd /
host# ee stable-cvsup
Scroll down to you see these lines:
# The following line is for 7-stable. If you want 3-stable or 2.2-stable,
# change “RELENG_6” to “RELENG_5” or “RELENG_5_2” respectively.
*default release=cvs tag=RELENG_7
*default delete use-rel-suffix
For the default host these is where you put the CVSup server closest to you. The other change you will make is for default release. If you are running a FreeBSD 7.x system change this to RELENG_7 this will bring you to 7.last. If you are running 7.x then change this to RELENG_7_2 which will bring you to 7.2.
Now we will let CVSup download all the updates.
host# /usr/local/bin/cvsup -g -L 2 /stable-cvsup
Now we have downloaded all the updates we will compile and install them. You can follow these steps. If you have built a custom kernel (you probably won’t be reading this) it is safest to build the GENERIC for the update then rebuilding for your custom kernel again, there are people who will just rebuild from the sources the custom kernel.
host# make -j4 buildworld (a)
host# make -j4 buildkernel (a)
host# make installkernel
(a) This option will allow the system to spawn concurrent builds. 4 is the number of builds and this is about the best for a single processor machine if you have a SMP server try 10.
Reboot your server.
host# make installworld
host# mergemaster -ai
Reboot your server
host# uname -a