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
FreeBSD host.domain.com 5.1-RELEASE-p1 FreeBSD 5.1-RELEASE-p1 #0: Fri Mar 12 16:17:31 EST 2004 [email protected]:/usr/obj/usr/src/sys/GENERIC i386
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:
*default host=cvsup.freebsd.org
*default base=/usr
*default prefix=/usr
# The following line is for 4-stable. If you want 3-stable or 2.2-stable,
# change "RELENG_4" to "RELENG_3" or "RELENG_2_2" respectively.
*default release=cvs tag=RELENG_5_2
*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 4.x system change this to RELENG_4_9 this will bring you to 4.9. If you are running 5.x then change this to RELENG_5_2 which will bring you to 5.2.1.
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# /usr/src
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# /usr/src
host# make installworld
host# mergemaster -ai
Reboot your server
host# uname -a
FreeBSD host.domain.com 5.2.1-RELEASE-p1 FreeBSD 5.2.1-RELEASE-p1 #0: Fri Mar 12 16:17:31 EST 2004 [email protected]:/usr/obj/usr/src/sys/GENERIC i386
Thanks for rhoekman, Xuru for also lending their help with this.
Let check to see what we are running:
host# uname -a
FreeBSD host.domain.com 5.1-RELEASE-p1 FreeBSD 5.1-RELEASE-p1 #0: Fri Mar 12 16:17:31 EST 2004 [email protected]:/usr/obj/usr/src/sys/GENERIC i386
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:
*default host=cvsup.freebsd.org
*default base=/usr
*default prefix=/usr
# The following line is for 4-stable. If you want 3-stable or 2.2-stable,
# change "RELENG_4" to "RELENG_3" or "RELENG_2_2" respectively.
*default release=cvs tag=RELENG_5_2
*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 4.x system change this to RELENG_4_9 this will bring you to 4.9. If you are running 5.x then change this to RELENG_5_2 which will bring you to 5.2.1.
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# /usr/src
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# /usr/src
host# make installworld
host# mergemaster -ai
Reboot your server
host# uname -a
FreeBSD host.domain.com 5.2.1-RELEASE-p1 FreeBSD 5.2.1-RELEASE-p1 #0: Fri Mar 12 16:17:31 EST 2004 [email protected]:/usr/obj/usr/src/sys/GENERIC i386
Thanks for rhoekman, Xuru for also lending their help with this.
Last edited: