OpenBSD Logo

Operating Systems: OpenBSD - Package Management System (Ports)

The ports tree is meant for *advanced users*. Everyone is encouraged to use the pre-compiled binary packages.
Ports tree is a set of Makefiles, one for each third party application, that controls:
  • Where and how to fetch the source of the software
  • Which other software it depends upon
  • How to alter the sources (if necessary)
  • How to configure and build it
  • How to test it (optional)
  • How to install or upgrade it
Apart from the Makefile, each port also contains at least the following:
  • PLIST - instructions for package creation once the application has been built
  • DESCR - description of the application
  • distinfo - distribution file checksums and size

The OpenBSD Ports Tree is located under: the */usr/ports* directory.
Ports collections (or ports trees, or just ports) are the sets of makefiles and patches provided by the OpenBSD operating system as a simple method of installing software or creating binary packages.
They are usually the base of a package management system, with ports handling package creation and additional tools managing package removal, upgrade, and other tasks.
The main advantage of the ports system is that the installation can be tuned and optimized according to available resources.
The main disadvantage is the increased compilation time, which can be significant. For example, a full installation of an OpenBSD system, using ports, can take several days, depending on the hardware.

Developers Notice: Porting your open-source software to OpenBSD

So you've just compiled your favorite software package on your OpenBSD machine and you want to share your effort by turning it into a standard port. What to do?

Example: Building a Port (software package) from Source Code to a binary package on OpenBSD:

cd /usr/ports/www/firefox-esr
make clean
make package BULK=yes
.... done
After 12..24 hours (depending on how performant is the building machine) you will have the binary package compiled as firefox-esr-x.y.z.tgz under (ex: for amd64): /usr/ports/packages/amd64/all/

Example: Installing a new binary Port (software package) or a custom binary Port to OpenBSD:

$ cat /etc/installurl

$ doas pkg_add firefox-esr
.... installation completed

$ doas pkg_add -D unsigned /usr/ports/packages/amd64/all/firefox-esr-x.y.z.tgz
.... custom installation completed

Example: Update an already installed binary Port (software package) on OpenBSD:

$ doas pkg_add -U firefox-esr
Updated to firefox-esr-91.13.0

Example: Find more information about an installed software package from OpenBSD binary Ports:

$ pkg_info firefox-esr
Information for inst:firefox-esr-91.13.0

Firefox web browser, Extended Support Release

Firefox is a full-featured standard-compliant web browser, built on the
Mozilla codebase by thousands of contributors around the world.
It is extensible through thousands of user-contributed extensions, and
 * Improved Tabbed Browsing, with tab grouping.
 * Private Browsing;
 * Spell Checking;
 * Search Suggestions;
 * Session Restore;
 * Web Feeds (RSS);
 * Live Titles;
 * Integrated Search;
 * Live Bookmarks;
 * Pop-up Blocker;
 * Phishing Protection;
 * Search Engine Manager.