Updating the Ports Tree

If you came from the previous section you will already be su'ed to root, but if not, "su" and when prompted enter your root password.

Ports is (in our opinion) the best system for installing software on any OS. With Ports, you can look for a FreeBSD application you want, go to its directory on your system, and with a simple command tell FreeBSD to download and compile the source, and install the app for you. This also allows you to set various flags (if desired) for compiling/installing the app, giving you a lot of control over the installation process.

In order to use Ports, the first thing we have to do is update our Ports tree. Think of your Ports tree as a big group of directories containing information about different apps that can be installed on your FreeBSD system. You can browse that information and decide what apps you want to install, then tell the system to install them. Based on the information in the Ports tree, FreeBSD will automatically connect to the proper download site, retrieve the application source for you, compile and install the app.

Portsnap is the tool we will use to update our ports tree. It is fast, and simple to use. The first time you run portsnap, it needs to download the entire ports tree, which is a download in the tens of megabytes.

portsnap fetch
portsnap extract

Henceforth, anytime you want to update your ports tree, you will only have to run this command:

portsnap fetch update

By updating the ports tree, you gain access to more recent versions of software available through ports. Thus, it is best to install software when your ports tree has been recently updated (within a week or so). If you try to install something from Ports and you receive an error message that it cannot be found, try updating your Ports tree. Some of these apps are updated regularly and old versions are replaced with newer ones.

In the past, CVSup was the method of choice for updating the ports tree; however, it is rather slow in comparison to portsnap. Thus, we only recommend using CVSup if you have a problem with portsnap, or if you need to update your base system, which portsnap cannot do. Directions for installing CVSup can be found here.

Return to our Previous Section        Continue on to our Next Section

Back to our FreeBSD Guide Home