$Id: ports.php 298 2009-12-30 01:53:00Z gjb $

Updating the Ports Tree

FreeBSD includes two mechanisms to update your ports tree -- portsnap(8) and csup(1). If you use (or have used) one tool or the other, continue to use that tool to update your ports tree. If you plan to switch to a different tool to update, remove your current ports tree to avoid version conflicts.

portsnap(8)

Issued without any arguments, the portsnap command will list all of the available options. This document covers three of these options -- fetch, extract, and update. The following command will fetch the latest ports tree snapshot from the portsnap servers:
portsnap fetch
When the download is complete, you can extract the ports tree (/usr/ports by default):
portsnap extract
These two steps can be completed in one line:
portsnap fetch extract
Once you have extracted the tree, you never have to extract the tree again. Instead, to get the latest version of the ports tree:
portsnap fetch update


csup(1)

csup(1) in the base install can fetch the cvs version of the ports tree. Start by pointing csup(1) to your favorite cvsup server -- in this example, I use cvsup11:
cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile
sed -i '' 's/CHANGE_THIS/cvsup11/g' /etc/ports-supfile
To update the ports tree, issue the following command:
csup -g -L 2 /etc/ports-supfile