pavement

Ports Tree, Updating

From FreeBSDwiki
Revision as of 21:34, 24 August 2004 by Dave (Talk | contribs)
Jump to: navigation, search

When updating your FreeBSD system, you'll first want to sync your sources to the live sources offered via cvs. There is a port cvsup that you can use to update your other ports and source trees if you want. If you hail from a Windows environment, you may think of keeping your sources updated as about the first half of the FreeBSD procedure which corresponds to Windows Update.

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 apporpriate for you and go into that directory and "make install clean":

   dave@samizdata:~% su -
   Password:
   samizdata# cd /usr/ports/net/
   samizdata# ls cvsup*
     cvsup:
     Makefile        distinfo        pkg-descr.nogui scripts
     README.html     pkg-descr       pkg-plist
     
     cvsup-mirror:
     Makefile        files           pkg-descr       pkg-plist
     README.html     pkg-deinstall   pkg-install     scripts
     
     cvsup-without-gui:
     Makefile        README.html
     
     cvsupit:
     Makefile        pkg-descr       pkg-plist
     README.html     pkg-install     pkg-req
         
   samizdata# cd cvsup-without-gui/
   samizdata# ls
    Makefile        README.html
   samizdata# make install clean

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:

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

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


So it's installed already, how do I update the ports tree?

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/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 or emacs to edit the ports-supfile.

In that file, you'll want to search for a string that says "CHANGE_THIS.freebsd.org" 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 freebsd.org but they all have the general form of cvsup(number).(country).freebsd.org such as cvsup1000000.qw.freebsd.org. 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.

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

    cvsup -g -L2 /root/ports-supfile

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.

It's updated. Now what?

Well, go into /usr/ports and find stuff you want to install!


See also: [The FreeBSD Handbook's section on cvsup and updating]

Personal tools