Slackware Pkgtools Guide
This page provides essential commands for managing packages in Slackware Linux using the pkgtools suite. Effective package management is crucial for maintaining a stable and functional system.
Slackware Package Creation with makepkg
The makepkg command is used to create Slackware packages from source or pre-compiled binaries. It automates the process of archiving and compressing files into a .tgz package.
# To create a Slackware package from a structured directory and sub-tree:
cd <dir>
su - c 'makepkg --linkadd y --chown n $foo-1.0.3-x86_64-1_tag.tgz'
Installing Slackware Packages with installpkg
The installpkg command is the primary tool for installing Slackware packages onto your system. It handles file extraction and placement.
# To install a Slackware package:
installpkg foo-1.0.3-x86_64-1.tgz
# To install a Slackware package to a non-standard location:
ROOT=/path/to/dir installpkg foo-1.0.4-noarch-1.tgz
# To create a backup of files that will be overwritten when installing:
tar czvf /tmp/backup.tar.gz $(installpkg --warn foo-1.0.4-noarch-1.tgz)
Upgrading Slackware Packages with upgradepkg
Use upgradepkg to update existing packages. It can intelligently handle new files and reinstall packages if necessary.
# To upgrade a Slackware package including files only in the new version:
upgradepkg --install-new foo-1.0.6-noarch-1.tgz
# To upgrade a Slackware package even if the version is the same:
upgradepkg --reinstall foo-1.0.4-noarch-1.tgz
Removing Slackware Packages with removepkg
The removepkg command safely uninstalls packages from your system.
# To remove a Slackware package:
removepkg foo-0.2.8-x86_64-1
# To remove a Slackware package, retaining a backup (uninstalled) copy:
removepkg -copy foo-0.2.8-x86_64-1 # -> /var/log/setup/tmp/preserved_packages/foo...