Welcome to the Slackware Documentation Project

This is an old revision of the document!


Package Management: A Hands-On Explanation

WORK IN PROGRESS

Anatomy of a Slackware package

A Slackware package is a simple TGZ or TXZ compressed archive containing:

  • the tree structure of files and directories ;
  • post-installation scripts ;
  • the package description.

The name of every package provides a series of informations:

  • the program name ;
  • the program version ;
  • the architecture of the package ;
  • the build number.

Here's a few examples:

  • emacs-24.2-i486-1
  • mozilla-firefox-15.0.1-i486-1
  • vim-7.3.645-x86_64-1

Managing Slackware packages using the traditional tools

Since its early releases, Slackware provides a collection of simple tools - the pkgtools - enabling the user to install, upgrade and remove software packages, as well as build them:

  • installpkg
  • removepkg
  • upgradepkg
  • explodepkg
  • makepkg

Installing software packages

Install the Emacs editor from the Slackware DVD 1):

# mount /dev/cdrom /mnt/cdrom
# cd /mnt/cdrom/slackware/e
# installpkg emacs-24.2-i486-1.txz
Verifying package emacs-24.2-i486-1.txz.
Installing package emacs-24.2-i486-1.txz [ADD]:
PACKAGE DESCRIPTION:
# emacs (GNU Emacs)
#
# Emacs is the extensible, customizable, self-documenting real-time
# display editor. If this seems to be a bit of a mouthful, an
# easier explanation is that Emacs is a text editor and more. At
# its core is an interpreter for Emacs Lisp, a dialect of the Lisp
# programming language with extensions to support text editing.
# This version supports X.
#
# http://www.gnu.org/software/emacs/
#
Executing install script for emacs-24.2-i486-1.txz.
Package emacs-24.2-i486-1.txz installed.
If you're using the CD set, Emacs is on the first CD.

Checking if a package is installed

The package installation process has created a new entry in /var/log/packages :

# ls /var/log/packages/em*
/var/log/packages/emacs-24.2-i486-1

Knowing if a package is installed boils down to checking the existence of the corresponding entry in /var/log/packages. Example :

# ls /var/log/packages/*firefox*
/var/log/packages/mozilla-firefox-15.0.1-i486-1

Firefox is installed on the system, in version 15.0.1. Another example :

# ls /var/log/packages/kdebase*
ls: cannot access /var/log/packages/kdebase*: No such file or directory

There is no kdebase-* package installed on the system.

Removing a package

Use removepkg to remove an installed package. The command can take the simple basename of the package as an argument. Example:

# removepkg emacs

It's also possible to provide the complete name as an argument. In that case, it's better to call the command from within /var/log/packages and use tab completion:

# cd /var/log/packages
# removepkg emacs-24.2-i486-1

Upgrading a package

Slackware provides security updates for its latest releases. Visit the official site to know more about the latest updates:

# links http://www.slackware.com
  1. Follow the ChangeLogs link.
  2. Check out Slackware-stable ChangeLog.
  3. Read the file ChangeLog.txt corresponding to the architecture of your system.

You can also use the Links browser to fetch updates manually. Before launching Links, create a /root/updates directory 2) to store your downloaded updates:

# cd
# mkdir updates
# cd updates/
# links mirrors.slackware.com
  1. Follow the Slackware File Tree link.
  2. Check out the directory corresponding to your release and architecture.
  3. Change into the patches/packages directory.
  4. Download any available updates.

Quit Links and install your updates like this :

# upgradepkg bind-9.9.1_P4-i486-1_slack14.0.txz

+==============================================================================
| Upgrading bind-9.9.1_P3-i486-1 package using ./bind-9.9.1_P4-i486-1_slack14.0.txz
+==============================================================================
Pre-installing package bind-9.9.1_P4-i486-1_slack14.0...
Removing package /var/log/packages/bind-9.9.1_P3-i486-1-upgraded-2012-11-21,12:14:32...
  --> Deleting /usr/doc/bind-9.9.1-P3/CHANGES
  --> Deleting /usr/doc/bind-9.9.1-P3/COPYRIGHT
  --> Deleting /usr/doc/bind-9.9.1-P3/FAQ
  ...
Verifying package bind-9.9.1_P4-i486-1_slack14.0.txz.
Installing package bind-9.9.1_P4-i486-1_slack14.0.txz:
PACKAGE DESCRIPTION:
bind (DNS server and utilities)
#
# The named daemon and support utilities such as dig, host, and
# nslookup.  Sample configuration files for running a simple caching
# nameserver are included.  Documentation for advanced name server
# setup can be found in /usr/doc/bind-9.x.x/.
#
Executing install script for bind-9.9.1_P4-i486-1_slack14.0.txz.
Package bind-9.9.1_P4-i486-1_slack14.0.txz installed.
  
Package bind-9.9.1_P3-i486-1 upgraded with new package
./bind-9.9.1_P4-i486-1_slack14.0.txz.

Another example :

# upgradepkg iptables-1.4.14-i486-2_slack14.0.txz
WORK IN PROGRESS

Sources

1)
if it's not already installed
2)
This is just an example, of course. Feel free to use any convenient place on your system.

In Other Languages
Translations of this page?:
QR Code
QR Code slackware:package_management_hands_on (generated for current page)