From FreeBSDwiki
Jump to: navigation, search

cvs stands for Concurrent Versions System. As the name implies, it is a version control system.

csup, which comes with the base system, was useful to update ports from cvs repositories. cvsup, which required heavy dependencies, may still be used for other mirroring tasks that don't apply to ports or updating sources. FreeBSD repository updates have been replaced by subversion, or ctm.

You can optionally install cvsup (or cvsup-without-gui). The cvsup program is the same as cvsup-without-gui if you do not have the X system installed, but many people prefer the non-gui version, as the cvsup version defaults to working in an X11 window (overridden with the -g flag).


Installing cvsup

You'll need to have superuser access, so su to root and then go to your /usr/ports/net/ directory. There are two versions of cvsup available to you: cvsup and cvsup-without-gui (for systems that don't have or need the cvsup GUI). Pick the one that's most appropriate for you and go into that directory and "make install clean":

   dave@samizdata:~% su -
   # cd /usr/ports/net/
   # ls | grep cvsup

so, let's say this is a headless server and I don't want X11 on it (which it is, and I don't) so:

   # cd cvsup-without-gui/
   # make install clean

and you'll get a lot of lines scrolling by; this is the program compiling.

Configuring your supfile

Csup uses the same supfile configuration as cvsup, and many of the commands for cvsup also apply to csup.

Not so fast, speed racer. First you need to configure your supfile. Go to /usr/share/examples/cvsup and look through the example files. The easiest way to make a supfile for your own personal use is to copy the one that want out of the examples and edit it. So from the command line, do a

   cp /usr/share/examples/cvsup/ports-supfile /root/ports-supfile

and you have just copied the ports-supfile over to the /root/ directory (root's home directory). Now you'll need to edit that file: use your favorite text file editor such as vi, ee (commonly aliased under FreeBSD as "edit"), joe, nano, pico, vim or emacs to edit the ports-supfile.

In that file, you'll want to search for a string that says "" and change that "CHANGE_THIS" to the name of a real CVSup server. You can get a list of the servers at the list of CVSup mirrors on but they all have the general form of cvsup(number).(country) such as It will almost always make the process much faster if you choose a mirror nearest you (or the country that you're in, rather.) Save your change to the file and exit your editor. An easy way to do this is to use sed:

# sed s/ /root/ports-supfile > /root/ports-supfile_complete

substitute a real number instead of # and et voila, you've got a useful ports-supfile, named /root/ports-supfile_complete.

To use cvs, you should have a file named standard-supfile or something similer in /usr/share/examples/cvsup. Copy it somewhere else, such as into /root, and open the copy with a text editor. 'here is an example of a supfile:

*default   pick a nearby server from [1]
*default base=/var/db
*default prefix=/usr                  source will be placed in /usr/src
*default release=cvs tag=RELENG_6     Replace RELENG_6 with your cvsup tag
*default delete use-rel-suffix
*default compress

This is basically a default supfile, with the host and release cvstag changed.

Save and close this file

Historical usage of cvs

How do I know which cvsup server to use?

Examples of release tags that would have been chosen are at FreeBSD Release Branches.

If you tried using fastest_cvsup recently, you can see that there are no or hardly any cvs servers to update FreeBSD.

The port fastest_cvsup takes (most of) the guess work out of finding the server that will be the fastest source for your location. Once you've installed it, you can use it on the command-line something like this:

# /usr/local/bin/fastest_cvsup -Q -c us
# /usr/local/bin/cvsup -h /root/ports-supfile-complete

What we did here was ask fastest_cvsup to look for the fastest connection to an official cvsup server, but to limit the search to those cvsup servers which are in the USA. (There isn't normally any point in querying servers that aren't even on the same continent that you are.) Then we called cvsup, but used the -h argument to force it to use instead of whatever cvsup server was specified in the supfile.

We can also get fancy and do both things in a single step:

# /usr/local/bin/cvsup -h `/usr/local/bin/fastest_cvsup -Q -c us` /root/ports-supfile-complete

Note that doing this does add a noticeable (10-15 seconds) delay while we locate the fastest server, and that that's really not something you generally need to do every time you update: it's generally better to go ahead and find the fastest server, then update your ports-supfile with it and leave it alone unless and until it starts to seem a lot slower than it used to / doesn't respond / etc. Also note that we used backticks (`), not single quotes ('). That tells the shell to execute whatever is inside the backticks and use the results in the command that we gave it.

It's installed and configured; how do I update the ports tree?

Once that's done, we're ready to actually update the ports. As root, issue this command:

# cvsup -g -L2 /root/ports-supfile_complete

In a perfect world, that will always work. The only times when it wont are when you don't have connectivity or the server that you're cvsup-ing against is not allowing connections. Strictly speaking, the -g command isn't necessary from a command line, since I installed cvsup-without-gui and the -g switch just makes sure that the GUI stuff in the regular CVSup program doesn't run. Since it isn't installed, I could have not given the switch and the command would have run just the same. The -L switch will give you error information, as well as a sort of progress-output -- the number next to the L (2 in this case) increases or decreases the verbosity of the output (0 is totally silent and 3 will give you everything you never wanted to read and more.) The last argument of the command is the actual ports-supfile that we made.

Updating your source using the file

Assuming you have the supfile in your root directory named standard-supfile, run as root:

csup /root/standard-supfile


cvsup -g /root/standard-supfile

The first time you run this command, it will probably take a significant amount of time. It will go out to the server you picked in the supfile, and attempt to update all of the source code needed to update FreeBSD to whatever version you have picked. Handbook references for gobs of details: Other methods of getting source, Details and optional flags to cvsup.

In a perfect world, that will always work. The only times when it wont are when you don't have connectivity or the server that you're cvsup-ing against is not allowing connections. The -g switch just makes sure that the GUI stuff in the regular CVSup program doesn't run, which many users prefer.

For more information and the full documentation visit the [offical website].

cvs replacements

portsnap, and freebsd-update, which come with the base system, and subversion (svn) are replacements for cvs' FreeBSD update functions. csup was a direct replacement for cvsup's ability to download source files and ports. freebsd-update can update release versions of this base system. Portsnap is a good replacement for updating ports. Subversion, from the devel category, or similar programs are options to check out other mirror repositories. For more information on subversion see: FreeBSD Handbook: Using Subversion which includes links to Apache Subversion Documentation, and the free online book Version Control with Subversion.

Personal tools