02-apr-2017: Dokuwiki and its plugins were upgraded to the latest release.
28-mar-2016: Welcome to our new server! Faster and less prone to crashing.

Welcome to the Slackware Documentation Project

Querying Installed Packages

Sometimes you might want to check whether a particular package is installed or which version of a package is installed on your system. If the package is part of the Slackware installation you could use the slackpkg tool:

# slackpkg info emacs

PACKAGE NAME:  emacs-24.1-x86_64-6.txz
PACKAGE LOCATION:  ./slackware64/e
PACKAGE SIZE (compressed):  36704 K
PACKAGE SIZE (uncompressed):  110720 K
PACKAGE DESCRIPTION:
emacs: emacs (GNU Emacs)
emacs:
emacs: Emacs is the extensible, customizable, self-documenting real-time
emacs: display editor. If this seems to be a bit of a mouthful, an
emacs: easier explanation is that Emacs is a text editor and more. At
emacs: its core is an interpreter for Emacs Lisp, a dialect of the Lisp
emacs: programming language with extensions to support text editing.
emacs: This version supports X.
emacs:
emacs: http://www.gnu.org/software/emacs/
emacs:

This works fine for Slackware core packages. Some of us, however, install additional programs from a number of sources (eg. SlackBuilds), which are not taken into account by slackpkg. Another method which includes all correctly installed* packages is as follows:

ls /var/log/packages | grep i3
i3-4.2-x86_64-1_SBo
i3status-2.5.1-x86_64-1_SBo

First we list the contents of the /var/log/packages directory which includes the names of all the currently installed packages. Then we pipe it to grep to narrow down the results and only display packages matching our pattern.

Another example showing all packages installed from Slackbuilds:

ls /var/log/packages | grep SBo

If you don't want to type it each time, you could create a very short script and add it to your path:

pkg.sh
#!/bin/sh
packages_dir=/var/log/packages/
 
if [ "$#" -eq 1 ]; then
        ls $packages_dir | grep $1
else
        echo "Please, provide one argument"
fi
$ pkg.sh cairo
cairo-1.10.2-x86_64-2
cairomm-1.9.8-x86_64-1_SBo
pycairo-1.8.10-x86_64-2
*Please note that if you directly run binary installers (eg. VirtualBox), a program will not have an entry in /var/log/packages/.

Sources


In Other Languages
Translations of this page?:
QR Code
QR Code howtos:slackware_admin:querying_installed_packages (generated for current page)