OpenBSD-101: Install software


#1

OpenBSD developers prefer users to use pkg_add(1) for installation of software which is equivalent to yum or apt-get of GNU/Linux systems. For using pkg_add(1) we need to setup mirror for our OpenBSD system using installurl(5).

A example of /etc/installurl might look like this:
https://ftp.openbsd.org/pub/OpenBSD

doas vi /etc/installurl

if you installed OpenBSD from Internet, the chosen mirror automatically and additional configuration is not needed. Otherwise, you can create it manually or specify your mirror preferred setting PKG_PATH as described in the manual pkg_add.

PKG_PATH
if a given package name cannot be found, searches the directories called by PKG_PATH. It should contain a number of entries separated by two dots. Each entry consists of a directory name. URL like FTP, HTTP, HTTPS, or SCP schemes are also appropriate. The current directory can be implicitly indicated by an empty directory name, or explicitly by a single point (’. /’). The special sequences ‘%a’, ‘%c’, ’ %’, ‘%v’ will be expanded.

Now for example if you want to install python on OpenBSD system :

doas pkg_add python

*Note doas(1) is sudo replacement for OpenBSD systems.