The quick-fix guide to Slackware Package Management.2
Installpkg installs Slackware packages just like pkgtool does, except it does it on the fly without you needing to choose from menus. The basic usage command is:
root# installpkg foo.tgz
This command will install foo.tgz into your system. However, newer files in the package will overwrite older files existing on your system. You will want to make note of what files will be installed on your system. This can be done by passing the -warn option. With the -warn option, installpkg will generate a report on what files will be installed, and you can then cross- reference to see if you have any existing files already on your system. Here’s a short example:
root# installpkg -warn foo.tgz
Scanning the contents of foo.tgz…
The following files will be overwritten when installing this package.
Be sure they aren’t important before you install this package:
-rwxr-xr-x root/root 1242 1999-06-05 12:34 usr/local/bin/foo
-rw-r–r– root/root 120 1999-06-05 12:34 usr/local/etc/foorc
You’ve been warned.
I recommend that you always use the -warn option before installing any package. Once you are sure you know what is being installed, you can go ahead and install the package.
removepkg removes an already installed package on the system. Like installpkg, this feature is also available by using pkgtool, except that this is run without a menu interface. removepkg needs to be used in the /var/log/packages directory. The syntax is:
root# removepkg foo
You need to be careful when using removepkg as it may delete a file you wanted to keep. You will want to use the -warn option with removepkg before actually removing a package. This can be done as follows:
root# removepkg -warn foo
Only warning… not actually removing any files.
Here’s what would be removed (and left behind) if you
removed the package(s):
Be sure you use the -warn option all the time before removing a package. Removing the wrong package will cause you uncessesary headaches. Know what you are removing before you remove it.
upgradepkg will upgrade an already existing package installed in your system. It does this by first installing the new package, and then removing any files from the old package that are not in the new package. Keep that in mind! If you need to keep any configuration files from the old package, be sure to back them up. upgradepkg works in two ways. If you have installed package foo.tgz and you want to upgrade it, and the new package is called foo.tgz, then the command to upgrade is:
root# upgradepkg foo.tgz
Otherwise, if you installed the package foo.tgz and the upgraded package is foo-2.0.tgz, then the command to upgrade is:
root# upgradepkg foo.tgz%foo-2.0.tgz
Notice the “%” symbol seperating both package names. This syntax is used when the upgraded package has a different name from the currently installed package. If the old and new packages both have the same name, just use the first example’s syntax.