How to update a FreeBSD installation with CVSup
From ArticleWorld
If you use FreeBSD and want a more flexible updating tool than sysinstall, you may find CVSup to be an excellent alternative. Unlike sysinstall, using CVSup may require more processing power, since you will compile a lot. On the other hand, you will get the chance to optimize you system better and, under some circumstances, provide a more convenient procedure (e.g. using distcc, you can balance the compilation on other machines, and avoid multiple reboots of the machine you upgrade. This can prove vital if you need uptime on it). CVSup also offers the advantage of providing you with the most up-to-date system possible: all FreeBSD mirror get the changes of the latest version in about an hour. This way, you no longer need to wait for formal releases. The following steps should be carried out as root.
Procedure
- Install the CVSup package. You can do that from ports:
# cd /usr/ports/net/cvsup # make all install clean
- Check that you have the current sources installed. If the directory /usr/src is empty, you should install them from the installation CDs. Mount the CD, and then:
# cd /cdrom/src # ./install.sh all
This will take about 300MB of space though, so make sure you have the space.
- Choose what you need to do, and select the supfile according to this. You will probably use ports-supfile (update the ports), stable-supfile (update to latest stable version) or standard-supfile (update to the --current branch, the latest version)
- Edit the supfile. You will have to choose a server and a release in the first place. You should refer to the CVSup documentation for an in-depth explanation of this.
- At this point, it is wise to prevent some packages from being updated using a refuse file. This should be placed in $PREFIX/sup/refuse. It has a format similar to this:
ports/german ports/french ports/games ...
Do note that it cannot contain comments. It is a bad idea to block vital sections like those under /usr/src though, since it can lead to compatibility problems.
- Run:
# cvsup [supfile]
replacing [supfile] with the supfile you have chosen. This will start a GUI if it can (start by clicking the green arrow in the corner of the window), or just start updating.
- Go to /usr/src and:
# make buildworld
Expect it to take a while. Then execute:
# make installkernel
and finally:
# mergemaster