E-Mail:
Get our new Windows 7 eBook (PDF) for $7 with 70+ Tips. Download Now!

Simplify Package Updates with Slackcurrent

  • No Related Post

Several weeks ago, I mentioned using the GUI-driven KSlackCheck to keep Slackware packages current. It’s a solid, dependable package, but obviously requires the user to go in and handle the downloads manually. Let’s say you want to script a solution instead. Enter Slackcurrent, a lightweight (only 15K!) Python script that performs the same task. In fact, Slackcurrent is the engine behind KSlackCheck!

Installing Slackcurrent is a piece of cake, just like any other Slackware package: simply download the .tgz and run installpkg or pkgtool. This places the slackcurrent.py script in /sbin.

There are a few options to running Slackcurrent, and they will be displayed if you run the script without arguments. Slackcurrent will allow you to check the remote (Slackware Current tree) filelist, check your local packages for comparison, and most importantly, generate a list of updated packages that you can download with wget.

Let’s go through an example. Start with slackcurrent.py -ul to get the latest list, and then slackcurrent.py -u will provide you with a list of updated packages in a textfile called slackcurrent.list. This can then be used by wget to fetch all of the updated files (and their checksums): wget -i slackcurrent.list.

The script runs interactively, but I thought it would be better if this could be scripted. I contacted the script developer, Eustáquio “TaQ” Rangel, and he remined me I could use the yes command to handle scripting:

yes no | slackcurrent.py -u

Per the man page, yes will simply output a string until it’s killed. As such, the above will output “no” until the script finishes its job. After that I can pass the results to wget and write a script to install everything, or, if I wanted to review the updates, I could have them emailed to me or even placed on a secured website. The possibilities are limited only by my skill with scripting.

Like KSlackCheck, slackcurrent.py also supports blacklisting. If, for example, I’m running on a production server with my own kernels, I can skip any kernel updates. I can also tell it to avoid anything in the Testing package tree. And if I want to keep my release stable, I can also limit the updated packages to those from the 10.0 or 10.1 tree rather than Current. The blacklist and mirrors (for changing the tree) files can be found in the /etc/slackcurrent directory.

Both Slackcurrent and KSlackCheck are handy packages to have on any Linux system. I like having the GUI when I’m running KDE on home systems, but Slackcurrent has been faster and easier to deal with on headless and remote Slackware servers. The scriptability also gives Slackcurrent a definite advantage on large networks.

What Do You Think?

 
35 queries / 0.366 seconds.