Updating the Ports Tree

General Information

The ports tree (/usr/ports) contains many useful programs that have been ported over to work on FreeBSD. Almost every tutorial here uses something from the ports collection in one way or another. Since all programs are constantly being updated, it’s a good idea to update your ports tree at least once every week to stay current with all the changes that are happening. While this tutorial will not tell you how to setup a program to upgrade every ports program you install (one does exist) it will tell you how to keep the make files current so you’ll always be compiling the latest version. For an extensive resource on what ports are constantly being updated see FreshPorts.org.

Requirements

  1. Local root access on the box or be able to su to root.
  2. A SSH client that supports ANSI colors such as puTTy or SecureCRT.
  3. Your favorite text editor (I prefer nano).

Installation

After logging on to the machine as root or su’ing to root, we need to install cvsup, the program that will download the latest information from the FreeBSD servers.

# cd /usr/ports/net/cvsup-without-gui
# make install
# make clean

Configuration

Now it’s time to make the config file that cvsup will use so it knows what to download from the FreeBSD update servers.

# cd /etc
# nano cvsupfile

Create and save a file that looks like the following:

*default  host=cvsup2.FreeBSD.org
*default  base=/usr
*default  prefix=/usr
*default  release=cvs
*default  tag=none
*default  delete use-rel-suffix
*default tag=.
ports-all
doc-all

To upgrade the ports tree at any time, simply log in as root and issue:

# cvsup -g -L2 /etc/cvsupfile

If you don’t want to upgrade the ports tree manually, you can make it automatic.

Speak Your Mind

*