Packages are the precompiled binaries of some of the most used programs. They are ready for use on an OpenBSD system. Again, like the ports, packages are very easy to maintain and update. Packages are constantly being added so be sure to check each release for additional packages.

Tools For Managing Packages

Where to find packages

     If you are a smart user and bought one of the OpenBSD CD, then packages can be found on both CDs depending on your architecture. If you don't have an OpenBSD CD in your possession you can download packages from any of the ftp mirrors. You can get a list of mirrors http://www.openbsd.org/ftp.html. Packages are located at /pub/OpenBSD/3.0/packages from there packages are broken down depending on architecture.

Installing Packages

     To install packages, the utility pkg_add(1) is used. pkg_add(1) is an extremely easy utility to use, in the following two examples pkg_add(1) will be used to install a package. The first example will show pkg_add(1) installing a package that resides on a local disk, the second example will show an installation of a package via ftp. In both examples screen-3.9.1 will be installed.

Installing via local disk
# pkg_add -v screen-3.9.1.tgz
Installing via ftp
# pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.0/packages/i386/pkg.tgz
The package `screen-3.9.1' will be registered at "/var/db/pkg/pkg". Viewing and Deleting Installed Packages

     The utility pkg_info(1) is used to view a list of packages that are already installed on your system. This is usually needed to find out the correct name of a package before you remove that package. To see what packages are installed on your system simple use:
$ pkg_info
mpg123-0.59r       mpeg audio 1/2 layer 1, 2 and 3 player
nmap-2.54BETA25    port scanning large networks
ircii-20011210     enhanced version of ircII (internet relay chat)
screen-3.9.1       multi-screen window manager
unzip-5.42         extract, list & test files in a ZIP archive
ntp-4.1.72 	   Network Time Protocol implementation
icb-5.0.9          Internet CB - mostly-defunct chat client
     To delete a package, simple take the proper name of the package as shown by pkg_info(1) and use pkg_delete(1) to remove the package. In the below example the screen package is being removed. Notice that on some occasions there are instructions of extra objects that need to be removed that pkg_delete(1) did not remove for you. As with the pkg_add(1) utility, you can use the -v flag to get more verbose output.

$ sudo pkg_delete screen-3.9.1

+---------------
| To completely deinstall the screen-3.9.1 package you need to perform
| this step as root:
|
|           rm -f /etc/screenrc
|
| Do not do this if you plan on re-installing screen-3.9.1
| at some future time.
+---------------