Introducing slackpkg+, an extension to slackpkg for 3rd party repositories
I want to introduce you to a tool written by Matteo Rossini (nicknamed zerouno of the Italian slacky.it community and contributor of several SlackBuild scripts at SlackBuilds.org as well as creator of the Slackware package search site slakfinder.org) with some serious contributions from phenixia2003, author of compat32pkg.
The tool is “slackpkg+“. It is not a stand-alone piece of software. In fact, it is an extension to Slackware’s package manager “slackpkg“. I will first describe the strengths of “slackpkg” and then come to the reasons why “slackpkg+” was written.
Slackpkg itself is a wrapper around the Slackware pkgtools (installpkg, upgradepkg, removepkg) with built-in package search capabilities and very useful when you want to keep your Slackware installation up to date. It was written with a modular design in mind: it can be extended with new functionality by adding new or extending existing functions in the “/usr/libexec/slackpkg/functions.d/” directory.
Slackpkg is my preferred tool for system upgrades (i.e. upgrading from one Slackware release to the next). People who do not use slackpkg usually have to do much more handywork like reading ChangeLog.txt entries for package additions, updates and removals, and/or follow the official Slackware guideline as found in “UPGRADE.TXT“. One disadvantage of the instructions found in UPGRADE.TXT is that the suggested “upgradepkg –install-new *.t?z” command will install every package you did not yet have installed – not just the packages that were introduced in the latest Slackware release but also the packages which you did not want to install anyway in the past.
Slackpkg allows you to keep full control over the packages that get installed, by showing you lists of candidate packages for every action you want to perform. You can de-select any package you do not want to be acted upon.
So far its strengths. The most heard “complaint” about slackpkg is that it will install and upgrade packages only from official Slackware repositories – it does not support 3rd party package repositories. This is why some users switch to other (unofficial) package managers like slapt-get, which do support 3rd party repositories. Slackware spin-offs like Salix and Vector use slapt-get. Slackpkg also does not allow you to keep a Slackware multilib installation correctly updated. The community tool compat32pkg was written for that purpose.
Both these issues (3rd party repository support and multilib support) are addressed in the slackpkg+ extension to slackpkg.
Slackpkg+ is NOT a new tool with new commands. Because it extends slackpkg, you can continue to use the well-known slackpkg commands after adding your 3rd party repository configuration:
# slackpkg update gpg
# slackpkg update
# slackpkg install openjdk
# slackpkg upgrade-all
The slackpkg+ extension also extends the search functionality in slackpkg:
# slackpkg search vlc DONE The list below shows all packages with name matching "vlc". [ Status ] [ Repository ] [ Package ] installed alienbob phonon-vlc-0.6.0-x86_64-1alien upgrade alienbob npapi-vlc-20130818-x86_64-1alien --> npapi-vlc-20130408-x86_64-1alien upgrade alienbob vlc-20130819-x86_64-1alien --> vlc-2.0.8-x86_64-1alien installed alienbob_current npapi-vlc-20130818-x86_64-1alien installed alienbob_current vlc-20130819-x86_64-1alien upgrade restricted npapi-vlc-20130818-x86_64-1alien --> npapi-vlc-20130408-x86_64-1alien upgrade restricted vlc-20130819-x86_64-1alien --> vlc-2.0.8-x86_64-1alien installed restricted_current npapi-vlc-20130818-x86_64-1alien installed restricted_current vlc-20130819-x86_64-1alien You can search specific files using "slackpkg file-search file".
You probably noticed that the package “vlc” is listed several times in this search exxample. That happens because I have this package in several repositories. You can (as shown further down) configure slackpkg+ with the correct priority in which these repositories are consulted when installing/upgrading software, so that the correct package will always be used.
Let me show you how I use slackpkg+ to maintain my computers.
I run Slackware-current 64-bit, with multilib added. I install my packages from multilib-current as well as my Slackware 14.0 package repository. Sometimes, I create a package specifically for Slackware-current (such as calibre, vlc, …) because the Slackware 14.0 version of that package will not work on Slackware-current. In such a case I want slackpkg to install the -current package and not the 14.0 package.
This is my configuration file “/etc/slackpkg/slackpkgplus.conf”:
PKGS_PRIORITY=( multilib:.* restricted_current:.* restricted:.* alienbob_current:.* alienbob:.* ktown:.* )
REPOPLUS=( slackpkgplus multilib ktown alienbob alienbob_current restricted )
A breakdown of these lines:
- You will notice that I have a local webserver running in my LAN (IP address 192.168.0.1) but you can use any public webserver which hosts these repositories. Having the repositories mirrored locally in the LAN has benefits for download speeds of course.
- The variable “SLACKPKGPLUS” determines whether the functionality of slackpkg+ will be enabled at all. If you set it to”off” then slackpkg will not use any of the new code. The default is “on”
- The “MIRRORPLUS” variables define an array of 3rd party repositories which you want slackpkg to know about.The array indices of the MIRRORPLUS array (like ‘alienbob’, ‘restricted’, ‘ktown’, etc…) are used in other variables, as will be explained next:
- The “REPOPLUS” variable defines which of the 3rd party repositories you have defined in MIRRORPLUS are actually actively used. The order in which the repositories are mentioned is not important.
- That repository order is important in the “PKGS_PRIORITY” variable. With this variable, you can force priority for certain repositories, or even for individual packages in these repositories. For instance, having “multilib:.*” listed first, means that my multilib package always have priority over the Slackware versions of these packages (gcc and glibc to be specific). Also, by defining the order “alienbob_current:.* alienbob:.*” I will ensure that when a package (such as calibre) is found in both repositories, slackpkg will install the one from the “-current” repository. The “.*” behind the repository’s name is a wildcard meaning “any package“. If you want you can make that more specific, like “restricted:vlc” which means “the vlc package in the ‘restricted’ repository“.
You will probably have added 3rd party packages to your slackpkg blacklist. When you install slackpkg+ you should of course remove those blacklist lines! If you don’t, then slackpkg will never show those blacklisted packages…
For instance, the lines you need to remove from “/etc/slackpkg/blacklist” in order to let slackpkg/slackpkg+ manage my packages, are:
The slackpkg tool parses the Slackware ChangeLog.txt to determine which packages are being added to Slackware. It looks for strings like “Added.” in the changelog when you run the command “slackpkg install-new”. This functionality does not work for 3rd party repositories. That means I can not simply run “slackpkg upgrade kde” to get my newest KDE “ktown” release installed – any package which is not present in Slackware itself, will not be installed with that command. On the other hand; keeping your “ktown” installed packages up to date afterwards, is easy with slackpkg+ because it will detect any upgrade to individual packages. .
The “slackpkg+” extension has its homepage on http://slakfinder.org/slackpkg+.html You can find more of slackpkg+ here:
- The git source code: https://github.com/zuno/slackpkgplus.git
- Packages (including source) for the stable releases: http://www.slakfinder.org/slackpkg+/
If you have a set of packages that are not part of any repository yet, and you want to create your own slackpkg+-compatible repository for them, you should check out an older article on this blog: http://alien.slackbook.org/blog/local-slackware-mirror/ . In there you will find an explanation about how to use my “gen_repos_files.sh” script.
Have fun! Eric