Determine what software is installed on a system

Author: name contact BSD flavour

Reviewer: name contact BSD flavour

Reviewer: Chris Silva FreeBSD/OpenBSD


Recognize that on BSD systems, software and dependencies are tracked by a package manager if the software was installed using packages(((packages))), ports(((ports))) or pkgsrc(((pkgsrc))). Be familiar with querying the package manager to determine what software and their versions are installed on the system.


TODO: what about non-packages?

On DrqagonFlyBSD and FreeBSD, view information about packages installed on the system by running: pkg info The package version and description for all packages will be listed. Information about a specific package is available by running: pkg info

On NetBSD and OpenBSD, view information about all packages installed on the system by running: pkg_info On OpenBSD, you may need to include the -a switch to show all packages, or the -A switch to show internal packages. On NetBSD, the -u switch allows you to view user-installed packages. Information about a specific package is available by running: pkg_info

More Examples

The following is quick example from a NetBSD mail server. (Note that the MTA software is not listed with pkg_info because it is included with the base system (i.e. the core operating system).

""# pkg_info ""digest-20060826 Message digest wrapper utility ""bash-3.2.9 The GNU Bourne Again Shell ""spamd-20070405 OpenBSD spam deferral daemons and tools

TODO add some more examples

TODO mention about FreeBSD's -x

The following example for FreeBSD's pkg_info uses the -W switch to show what package a file belongs too. (You can also use an full path to the filename.)

""# pkg_info -W pal2rgb ""/usr/local/bin/pal2rgb was installed by package tiff-3.5.7

With pkgsrc, this can be done with the -F switch which shows details for the package owning the file (using full path). Use -Fe to just show the package name, for example:

""$ pkg_info -Fe `which ps2pdf` ""ghostscript-gnu-8.15nb3

(Notice this example runs which to get full path of the command.)

Practice Exercises

More information