Installing applications
Out of the box, there’s no nifty graphical package installer in OpenBSD.
Installation can be performed by two methods:
1) The traditional method of building from source and installing
2) Downloading and installing pre-build binaries from CD or over the Web
For my experimenting, I’ll be installing binaries.
Though the absence of a package manager may seem a bit burdensome, the reality is that OpenBSD, IMHO, is best suited for a server environment where the number of installed packages should be quite small.
The bare-bones install of OpenBSD is very thin, requiring little more than is needed to get the host to boot a kernel.
From a security perspective, this is a bonus. Smaller install set = smaller attack surface.
The other thing I like is that it’s pretty easy to script the installation of packages, greatly simplifying the process of creating standard builds for web servers, database servers, etc.
Purchasing copies of the CD’s help to support the project, and packages can be installed directly from CD.
I don’t have the CD’s, so I’ll be installing from the Web.
The overall process is pretty straight forward:
1) Select an FTP mirror
2) Identify the package(s) to install
3) Use the pkg_add command to install
From scratch, here’ the process for installing the latest pre-built nmap package:
# ftp -4 -V ftp://ftp.openbsd.org/pub/OpenBSD /4.3/packages/i386/index.txt
100% |**************************************************| 105 KB 00:01
# grep nmap index.txt
nmap-4.53.tgz
nmap-zenmap-4.53.tgz
# pkg_add ftp://ftp.openbsd.org/pub/OpenBSD /4.3/packages/i386/nmap-4.53.tgz
lua-5.1.2p1: complete
libdnet-1.10p2: complete
nmap-4.53: complete
# nmap -p80 localhost
Starting Nmap 4.53 ( http://insecure.org ) at 2008-05-20 04:18 EDT
Interesting ports on bsdvm.localdomain (127.0.0.1):
PORT STATE SERVICE
80/tcp closed http
Nmap done: 1 IP address (1 host up) scanned in 0.334 seconds
#
For some reason, I was having trouble connecting to FTP servers… I kept getting the following error:
435 Can’t build data connection: illegal port number
I suspect the reason is the network I’m on, but who knows.
I also found that many of the mirrors didn’t have the latest 4.3 builds, which may not be too suprising as 4.3 was released only a few weeks ago.
Identifying what is installed
Ok, so now I know how to install, how do I tell what’s on my box?
The pkg_info command will list all packages installed on the host.
For example:
# pkg_info
atk-1.20.0p0 accessibility toolkit used by gtk+
cairo-1.4.14 vector graphics library
desktop-file-utils-0.14p1 utilities for 'desktop' entries
...
For further information on a package, you can:
# pkg_info <pkg name>
This will give detailed information about a package, including it’s full version (if it can be determined) and any dependencies…
For example:
# pkg_info tiff
Information for inst:tiff-3.8.2p0
Comment:
tools and library routines for working with TIFF images
Required by:
gtk+2-2.12.7
Description:
This software provides support for the Tag Image File Format (TIFF), a widely used format for storing image data.
...
Maintainer: The OpenBSD ports mailing-list <ports@openbsd.org>
The documentation is quite extensive, and I recommend reading the FAQ and the MAN pages.
I certainly haven’t made it through all the documentation yet :)
Next time, getting Apache, PHP, and MySQL running…
Bill