Ports and Packages

The FreeBSD Ports and Packages Collection provides a simple and consistent method for users and administrators to install applications on the FreeBSD operating system. “Packages” are in reality precompiled binary ports. There are nearly 17,700 ports in the collection and are available for download.

The Ports Management Team was formed to take over the maintenance of core ports framework from its author Satoshi Asami, who maintained it for several years. The responsibility for keeping each port or software package up-to-date with the latest software updates lies with individuals. Anybody can volunteer to become a port maintainer by contributing some software. An individual can also assume responsibility for any existing port that does not have any “owner”.

A port skeleton is a minimal set of files that tell the FreeBSD system how to cleanly compile and install a program.The collection makes use of Makefiles, which are present in a directory hierarchy. This enables software to be built, installed and removed with the command make. Little intervention from the user is required while installing any application after the issuance of the initial command.

The distinfo file contains information about files that must be downloaded to build the port, and their checksums, to verify that files have not been corrupted during the download. The files directory contains patches to make the program compile and install on the FreeBSD system. Some ports have other files, such as pkg-message which are used to handle special situations. Patches are basically small files that specify changes to particular files. Mostly, applications are downloaded automatically from the Internet, and if need be, patched and configured, compiled, installed, and registered in the package database. All dependencies, applications or libraries that a port may have are installed automatically in the beginning. A “pointyhat cluster” or build farm is maintained by FreeBSD to build packages across all architectures and major releases. It also keeps build logs and errors for all ports built by the pointyhat cluster.

All package information is stored within the /var/db/pkg directory. The installed file list and descriptions of each package can be found within files in this directory. Installation of packages is easy and automated if the user knows the name of the package. The package name is simply passed to the command pkg add –r. The correct package for that release is downloaded and installed, including any dependencies. By default, the downloaded happens from the FreeBSD distribution site. All precompiled packages are divided into categories based on the architecture for which they are available. These packages are divided into several directories:

“Release” directories are for current production releases, built from ports collection shipped with the release and not updated subsequently. “Stable” and “current” directories are for major release branches and are updated approximately once a week. Packages created for older versions of FreeBSD are installed and used on later systems with no problems due to binary backward compatibility which is enabled by default across all major releases.