My name is Jeaye

I'm a leader, a problem solver, and a hacker with a passion for privacy and security.

sbopkg on Slackware

Package management in Slackware (14.1, currently) has a reputation for being rather manual. The official packages are distributed as binaries, with the source included, and can typically be manipulated using the slackpkg tool exclusively. SBo provides hundreds of unofficial packages, ranging from games, to multimedia players, to desktop environments.

The process of building a Slackbuild, as given by SBo, is well documented, so catch up with that elsewhere. A handy tool, sbopkg, provides a simple CLI for installing SBo packages. Since sbopkg is unofficial, you’ll need to get it installed first.

Installation

After navigating to the SBo download page and getting the latest package, simply install it, replacing the version and arch as needed:

> installpkg sbopkg-version-noarch-1_cng.tgz

Initial run

sbopkg, by default, always needs to be run as root. The first time you start using sbopkg, you may be prompted with a choice to create the proper directories. For me, that often looks something like:

The following directories do not exist:

Variable                   Assignment
--------                   ----------
TMP ---------------------> /tmp/SBo

You can have sbopkg create them or, if these values are incorrect, you can
abort to edit your config files or pass different flags.

(C)reate or (A)bort?:

This is because I run rm -rf /tmp/* in /etc/rc.d/rc.local_shutdown; you can configure your sbopkg in /etc/sbopkg/sbopkg.conf. The defaults have always felt sane to me.

Syncing

To sync sbopkg with the remote SBo, simply run:

# Think of 'r' as in 'rsync'
> sbopkg -r

Searching

Before knowing what you can install, you need to search the available packages. Let’s say we wanted to play the best FPS, Quake 3. First, we’ll search for quake:

# Think of 'g' as in 'grep'
> sbopkg -g quake

Searching for quake
Found the following matches for quake:
games/ioquake3
games/quake3_shareware_data
games/quakeforge
games/quake_shareware_data
games/yamagi-quake2

Inspecting

So, now we can see that ioquake3 is what we want. Following the Slackware way, sbopkg doesn’t resolve dependencies for you. It does, however, provide you with the required SBo packages of each SBo package; it assumes you have a full Slackware install as well. We can inspect a package as follows:

# Think of 's' as 'search' or 'inspect'
> sbopkg -s ioquake3

This will show you the README, Slackbuild, .info, and slack-desc for the supplied package. Since, most of the time, the most interesting bit is the dependencies, this query can be optimized. I have this saved as ~/bin/sboreq where ~/bin is in my $PATH.

#!/bin/sh
echo | sbopkg -s "$1" | grep REQUIRES

The leading echo gets rid of the Hit any key to continue: bit by sending in a new line. To use this script, simply pass it the package name:

> sboreq ioquake3

REQUIRES="OpenAL SDL2"

Installing

Now that we know what we want, we can try to install it. SBo is source-oriented; almost all packages will be built entirely from source when you install them (either by sbopkg or manually). For binaries of SBo packages, see SlackOnly. If you haven’t satisfied the dependencies, the build will likely fail; you can always install them and try again.

> sbopkg -i ioquake3

Of course, since we know ioquake3 depends on OpenAL and SDL2, we should install those as well.

# Either specify a -i for each package
> sbopkg -i OpenAL -i SDL2 -i ioquake3

# Or quote them
> sbopkg -i "OpenAL SDL2 ioquake3"

sbopkg will then do some processing work and ask you if you want to proceed:

...
bunch of stuff
...

Do you wish to proceed based on the search results above? Packages not
found will be skipped during the process.

(P)roceed or (Q)uit?:

If everything looks good, sbopkg knows which packages you’re referencing, proceed with the installation. sbopkg will download all of the required sources for your architecture and it will run the required Slackbuild. To see where all of these Slackbuilds are cached, navigate to /var/lib/sbopkg/SBo/14.1 where 14.1 represents your Slackware version. In there, you can see a reference to all known SBo packages, categorized for clarity.

Tweaking builds

Now that you have Quake installed and you’ve fragged for a while, you realize that there’s a feature of ioquake3 about which you know, or a compiler setting, from which you can benefit, yet it’s not enabled. Fortunately, sbopkg allows configuration of each Slackbuild by copying the original to an appropriately named version. Let’s modify one.

# Navigate to the sbopkg cache
> cd /var/lib/sbopkg/SBo/14.1/

# Find ioquake
> find . -type d -name ioquake3
./games/ioquake3
> cd games/ioquake3

# Copy ioquake3.Slackbuild to ioquake3.Slackbuild.sbopkg
> cp ioquake3.SlackBuild{,.sbopkg}

Now we can edit ioquake3.Slackbuild.sbopkg all we want, maybe adding new CFLAGS. When we try to install ioquake3 again, using sbopkg, we’ll now be prompted.

A local SlackBuild file for ioquake3 was found in addition to the original
SlackBuild file.

Use (O)riginal/(L)ocal, see (D)iff, or (C)ancel?:

Of course, we can use the original, or our version (local), or even view the diff. To use our modified version, we’d submit “L” here. When upgrading SBo packages, you’ll need to manually diff the original with your local version to see what has changed; at the very least, the VERSION will have changed.

Updating

sbopkg supports two forms of updating.

  1. Updating sbopkg itself
  2. Updating installed SBo packages

For the former, you can simply run:

# Think of 'u' as 'upgrade'
> sbopkg -u

For the latter, which is arguably more common, simply run:

# Think of 'c' as 'check for updates'
> sbopkg -c

# Example output
Listing installed SBo repository for Slackware 14.1 packages and flagging
potential updates...

webkitgtk3:
  POTENTIAL UPDATE
  Installed version:  webkitgtk3-2.4.8-x86_64-1_SBo
  Repo version:  webkitgtk3-2.4.9-x86_64-1_SBo

Potential update list complete.

NOTE: The sbopkg -c command does not update the packages; it just checks for updates. To update an outdated package, just install it again, using sbopkg -i.

Uninstalling

When you’re ready to uninstall a package which was installed via sbopkg, just use the normal Slackware tools. That is, if we want to get rid of ioquake3 and it dependencies, we’ll do:

> slackpkg remove ioquake3 OpenAL SDL2

# We'll now enter a screen where we can verify our removal

Further reading

sbopkg has an excellent man page, man sbopkg, and it also has docs available online.