- blog.up-link.ro - https://blog.up-link.ro -

OpenBSD: How To Install OpenBSD Ports and Packages Collection

OpenBSD is a fairly complete system of its own, but still there is a lot of software that one might want to see added.

The port collection, originally borrowed from FreeBSD and significantly rewritten, fills this gap. The concept is to have, for each third-party software, a Makefile that controls:

This information is kept in a directory hierarchy under the /usr/ports directory.

Packages are the binary equivalent of ports. A compiled port becomes a package that can be easily installed and registered into the system using pkg_add utility.

1. Getting Ports Collection

Change the current directory to /usr, enter:

cd /usr

Use ftp utility to get the ports collection, enter:

ftp ftp://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/ports.tar.gz

Extract the ports collection:

tar -zxvf ports.tar.gz

2. Installing packages from ports

For example, to install bash from OpenBSD ports, use the following commands:

/usr/ports/shells/bash
make install clean

3. Uninstalling a port's package

For example, to uninstall bash use the following commands:

/usr/ports/shells/bash
make uninstall

NOTE: The ports and packages collection does NOT go through the thorough security audit that the OpenBSD base system does.