More Useful Package Management Tools

I stumbled across two useful FreeBSD package management tools yesterday. One is graphical and the other works via the command line. Both help administrators understand dependency issues when they might want to clean out unnecessary packages.

Keep in mind that installing software via the FreeBSD ports tree results in the installation of a package, but not necessarily the creation of a package that can be moved among systems. That is why administrators can install software with the ports tree and then use the FreeBSD pkg_info, pkg_delete, and other pkg tools to manipulated deployed applications.

The first tool is gpkgdep, in the ports tree as sysutils/gpkgdep, by Jack Slater. This is an older tool but it works fine on my FreeBSD 5.2.1 REL system. Gpkgdep has good online documentation, but I'll quickly describe its use via a few screenshots.



This screen shot shows the "Required Packages" tab. It shows all installed packages, not all of the packages which could be installed. (This differs from a tool like sysutils/pib, a Tcl/Tk tool which presents information found in the ports index.) At the top of the screen shot we see "nmap-3.5.0", with "pcre-4.5" indented below. This means pcre is a dependency of nmap, i.e., nmap needs pcre to run. If we wanted to remove pcre, it would prevent us from running nmap. Further down the list we see "p0f-2.0.3_1", which has no arrow to the left of its name nor anything listed below. This means p0f has no dependencies.



The next screen shot shows the "Dependent Packages" tab. This lists packages followed by their dependencies. In this view, we're looking at "pcre-4.5" at the top. Indented below it we see "ethereal-0.10.3" and "nmap-3.50". This means both ethereal and nmap depend upon pcre.



The final screen shot displays the "Remove Package Simulation." Here we can select packages and see their dependencies selected automatically. Here we see "ethereal-0.10-3" selected, and gpkgdep has dynamically selected Ethereal's dependencies. They are show with slightly greyed-out boxes.

Turning to the command line environment we have sysutils/pkg_tree by Edwin Groothuis. This tool provides similar information in CLI form. To see Ethereal's dependencies, try this:

$ pkg_tree ethereal
ethereal-0.10.3
|\__ jpeg-6b_2
|\__ libiconv-1.9.1_3
|\__ python-2.3.4
|\__ png-1.2.5_5
|\__ pkgconfig-0.15.0_1
|\__ perl-5.6.1_15
|\__ pcre-4.5
|\__ expat-1.95.7
|\__ net-snmp-5.1.1_4
|\__ gettext-0.13.1_1
|\__ libxml2-2.6.9
|\__ freetype2-2.1.7_3
|\__ tiff-3.6.1_1
|\__ imake-4.3.0_2
|\__ fontconfig-2.2.2,1
|\__ XFree86-libraries-4.3.0_7
|\__ XFree86-fontEncodings-4.3.0
|\__ glib-2.4.1_1
|\__ libXft-2.1.6
|\__ shared-mime-info-0.14_2
|\__ hicolor-icon-theme-0.5
|\__ atk-1.6.1
|\__ adns-1.0_1
|\__ XFree86-fontScalable-4.3.0
|\__ pango-1.4.0_1
\__ gtk-2.4.1
tethereal-lite-0.10.3
|\__ pkgconfig-0.15.0_1
\__ glib-1.2.10_11

This shows all of the packages needed by Ethereal and also Tethereal. Nmap is simpler:

$ pkg_tree nmap
nmap-3.50
\__ pcre-4.5

If you want to see all of the dependencies for the listed packages, use the -v option:

$ pkg_tree -v ethereal
ethereal-0.10.3
|\__ jpeg-6b_2
|\__ libiconv-1.9.1_3
|\__ python-2.3.4
|\__ png-1.2.5_5
|\__ pkgconfig-0.15.0_1
|\__ perl-5.6.1_15
|\__ pcre-4.5
|\__ expat-1.95.7
|\__ net-snmp-5.1.1_4
| \__ perl-5.6.1_15
|\__ gettext-0.13.1_1
| |\__ libiconv-1.9.1_3
| \__ expat-1.95.7
|\__ libxml2-2.6.9
| |\__ python-2.3.4
| |\__ pkgconfig-0.15.0_1
| \__ libiconv-1.9.1_3
...truncated...

If you run this tool without any options, it queries the package database for every installed application.

Keep these tools in mind when you feel like doing some package house cleaning.

Comments

Popular posts from this blog

Zeek in Action Videos

New Book! The Best of TaoSecurity Blog, Volume 4

MITRE ATT&CK Tactics Are Not Tactics