Slackware resurrection
#19 Henry, Wednesday, 09 December 2009 2:50 PM (Category: Apple)
(Tags: slackware slackpg)

I got a strong reaction when I said I was prepared to leave Slackware and go to some other Linux distribution. Several people offered good advice, and one person, Matthew, volunteered to come to the next TWUUG meeting and show me how Slackware could meet my needs and solve my problems and ease my frustrations. We both came to the next TWUUG meeting and I learnt a whole new area of Slackware that I did not know about. I've been using Slackware since 1994, and I must have stopped learning at some point because I missed a whole bunch of development and I got left behind.

My frustrations were basically that

Matthew showed me how to get around all these issues.

I already knew how Slackware package management worked. You get a package from some source, and you install it with installpkg, remove it with removepkg, and update it with upgradepkg. I already knew this and had used it often.


But what I did not know about was the level above that, that allows you to keep your whole Slackware installation up to date. This revolves around the use of slackpkg. This is like apt-get on other distributions.

You start by deciding whether you want to keep your Slackware installation current to the release but with security patches added. This is the stable path. So right now, Slackware 13.0 is the release. Or you can keep it up to date to 'current', which includes all updates to all packages. You move away from the stable release, but your software is more cutting edge.

Your first step is to go down to root, then edit the file /etc/slackpkg/mirrors and set your repository. I was advised to use because of its physical proximity to where I am, so I found the line in the mirrors file that matched that repository and I uncommented it. Other parts of the world or the USA should choose a repository closer to them. Then you choose whether you want to stay in sync with 13.0 or with 'current'. If you choose 13.0, you have no more changes to make with the mirrors file. If you want to stay on the bleeding edge and go with 'current', and I did, you edit that line you just uncommented and you change the 13.0 at the end of the line to be current. Like this:

With that single line changed, you are now ready for the magic and you can keep your system in sync. You now use slackpkg and you call:

slackpkg update

This will look at the Change Log at the repository and determine if there are any changes. It will bring the Change Log down to your box and analyse it and convert it so slackpkg can use it. Then you will want to make any updates necessary, so you call

slackpkg upgrade-all

This will work through the Change Log and determine what packages need changing. It will display them and let you selectively choose to update them or ignore them. When you say Go, it will go ahead and update all the packages you said it should update. If any of these packages have config file changes that might interfere with your existing config files, it will alert you to this and give you options. Do not just let it install the new config files. I did that and swore a lot and had to find my config file backups.

Then when the updates are done, you will want to see if there are new packages to install, so you call

slackpkg install-new

and you get to choose from the list of new packages (if there are any). And finally, you want to see if old stuff needs to be deleted.

slackpkg clean-system

Matthew gave me a script that combines all these steps:

slackpkg update
slackpkg upgrade-all
slackpkg install-new
slackpkg clean-system

At work, I go through a proxy so I needed a modification to this script:


# Set the proxy
export http_proxy="http://proxy.internal:3128/"
export ftp_proxy="http://proxy.internal:3128/"
export HTTP_PROXY="http://proxy.internal:3128/"
export FTP_PROXY="http://proxy.internal:3128/"

# Start the slackpkg ritual
slackpkg update
slackpkg upgrade-all
slackpkg install-new
slackpkg clean-system

So whenever I get word from Slackware about security updates (I am on the Slackware security mailing list), or I hear about updates to packages I use, or I just want to check for updates out of boredom, I drop down to root and run this script. I answer the questions, I watch what gets installed or updated, and my system stays up to date. Occasionally there are kernel changes, and after the updates, I reboot the box. It depends on what comes down. You can't add this to cron because it's an interactive tool.

So this keeps my system up to date. Learning about this solved a big problem for me and made me very happy.


Then came the problem of getting other packages. I wanted Audacity and failing to get it was what started me on this whole saga.

Matthew showed me a web site that provides ways of creating other packages - This site provides a way to build packages for Slackware. I looked under the Repository, then under Audio, and there was the build scheme for Audacity.

I read the README file and it showed that I needed two other packages - libsndfile and wxPython. Both of these are available on I went to each of these (libsndfile and wxPython),and downloaded the source code and the SlackBuild script.

As root, I set up an area for the SlackBuilds scripts. I keep a lot of data in a central location called /data, which makes it easy to back stuff up. I created a new directory called /data/slackbuild. I moved in to that directory and untarred the slackbuild file for libsndfile.

cd /data/slackbuild
tar xvzf /home/myuser/downloads/libsndfile.tar.gz

This created a directory called libsndfile with the SlackBuild files in it. I moved into that directory, copied the source code file into it and then ran the SlackBuild script.

cd libsndfile
cp /home/myuser/downloads/libsndfile-1.0.20.tar.gz .
sh libsndfile.SlackBuild

This untarred the source file and then automatically did the configure and make. At the end, it created a Slackware package containing libsndfile built and ready for installation. It was created in /tmp. When it was done it said

Slackware package /tmp/libsndfile-1.0.20-i486-1_SBo.tgz created.

Now I could easily install it with

installpkg /tmp/libsndfile-1.0.20-i486-1_SBo.tgz

Best of all, I can transfer this package to all my other Slackware boxes and install it with installpkg.

I followed the same procedure for wxPython and Audacity, and they each worked the same way and it was painless, and it was easy, and it just worked. I was pretty ecstatic.

There is one more step to make. If you run the script above to update Slackware with slackpkg, the instruction to 'slackpkg clean-system' will want to remove these SlackBuild packages because they are not part of the official Slackware release. You want to change this behaviour by editing the file /etc/slackpkg/blacklist, and adding the base name of the SlackBuild packages to the list of packages to be ignored. So I added these lines to that file:


When I went to do OpenOffice, I ran into one small problem. The defaults for the SlackBuild scripts is to put temporary files and the resulting packages in /tmp. This caused my root partition to run out of space. I had a look in the .SlackBuild scripts and found that you can override these defaults. I decided to keep the temporary files and the packages under the /data/slackbuild structure so I created two new directories - /data/slackbuild/tmp and /data/slackbuild/packages, and I added these lines to my root .bash_profile (yes, I know it's a security breach to have a root .bash_profile):

# Set some SlackBuild environment variables
export TMP=/data/slackbuild/tmp
export OUTPUT=/data/slackbuild/packages

and that solved this problem.


And that solved all my immediate frustrations and allowed me to get going with Audacity again. I learned a bunch of other things too, but I'll describe them later as I get more familiar with them. I learnt about sbopkg which makes the SlackBuild procedure more automated. And I learnt about setting up your own Slackware repository so if you have multiple boxes to keep up to date, you don't have to hit the official repositories all the time, you can keep your own repository in sync (you hit the official repositories once) and then all your boxes hit your private repository. It's being network responsible. I am setting this up now, and I'll describe it when I have succeeded.