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
emacs: emacs (GNU 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: http://www.gnu.org/software/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

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:

if [ "$#" -eq 1 ]; then
        ls $packages_dir | grep $1
        echo "Please, provide one argument"
$ pkg.sh cairo

*Please note that if you directly run binary installers (eg. VirtualBox), a program will not have an entry in /var/log/packages/.


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