## 40.10. Installing with FreeBSD Packages

Instead of using the Ports you can install applications individually as packages, using the pkg_add utility, similar to that shown in (40.08).

To install using pkg_add, download the package by ftp'ing to the FreeBSD FTP server at ftp2.FreeBSD.org, and then change to the /pub/ports/packages directory. At that point, the directory at the FTP server should be similar to the Ports collection directory organization. Change directory to the category (such as "lang"). Get the gzipped tar (Section 15.7) file of the package for your application, using binary transfer. For instance, the Ruby scripting language interpretor is ruby-1.7.2.2002.05.23.tgz, which is then downloaded:

>     ftp > get /pub/ports/packages/lang/ruby-1.7.2.2002.05.23.tgz

Once the file is downloaded, type `pkg_add` and the package name:

>     # pkg_add ruby-1.7.2.2002.05.23.tgz

Instead of downloading the file manually, you can use the -r option to have the pkg_add application look for the latest build of an application and automatically download necessary dependent files and the target application itself:

>     # pkg_add -r ruby-1.7.2.2002.05.23.tgz

Note, though, that the newest versions of an application may not be in the stable build directory. If you want an application not on this tree, you'll have to download the application file manually.

-- SP

Copyright © 2003 O'Reilly & Associates. All rights reserved.