Slackware hackery


Following the utter debacle of the store ripping Patrick off, he has now set up a Patreon where you can and should sign up to reward him for decades of stalwart maintenance of this most venerable distribution. Do it now, before you forget.


Fed up with that crazy horizontal scrolling you get on the command line? Yearning for proper, wrapping text instead?

sudo cp -b -S.dist /etc/termcap-BSD /etc/termcap

Simple and effective.


Sendmail configuration is the ne plus ultra of the dark arts. However, Slackware has one or two little tricks to catch those foolish/confident enough to try. Top of the list is that the aliases file resides in /etc/mail and not one level above as in other distros. Here be dragons.

Also, the statistics file isn't enabled by default so you will need to add

O StatusFile=/etc/mail/statistics

to and restart if you want to log the stats. The specified file should already exist.

The .mc file is at /usr/share/sendmail/cf/cf/ It would be best to copy this somewhere else, modify that and then apply it with

m4 > /etc/mail/


Slackware uses dcron which is smaller than the crons used by other dists (vixie, cronie, chrony, etc.) but still fairly full-featured. There are some caveats, though.

  • There is no /etc/crontab so don't create one and think it will do anything.
  • There is no username field in the /etc/cron.d entries (or in any other crontab files).
  • Changes to the entries in /etc/cron.d are not immediately picked up — it can take an hour or so. Only a restart seems to avoid this delay.
  • Nothing is logged by default (at level "notice"). If you want job runs to be logged you'll need to drop this down to "info" or below. It's set at launch in /etc/rc.d/rc.M with the -l option.
  • There's no MAILTO variable so expect STDERR and STDOUT to be mailed to the user running the job even if you include MAILTO in the crontab file.


The batch limits need to be tweaked for any system with more than one core. Edit /etc/rc.d/rc.M and set the load limit to something appropriate. eg. for a 4-core system:

/usr/sbin/atd -b 15 -l 3.8

Sometimes the ownership of the files and dirs used by at gets a bit messed up. A full fix appears to be (as root):

slackpkg reinstall at
chown daemon:daemon /var/spool/at* /var/spool/atjobs/.SEQ
chgrp daemon /etc/at.deny


amavisd-new is available as a slackbuild but there are a couple of problems with the documentation.

  • The command to add the amavis system user is given as
    useradd -d -m /var/lib/amavis -s /bin/bash -u 211 -g 211 amavis
    However, this fails on Slackware 14.2 because the -d expects the directory path to follow immediately and therefore it thinks that "-m" is the directory to use and it does not like the name. Simply reversing these two flags in the line fixes it. ie:
    useradd -m -d /var/lib/amavis -s /bin/bash -u 211 -g 211 amavis
  • The README.SBo says:
    RUNTIME DEPENDENCIES: ZeroMQ library -- since amavisd-new version > 2.8.x, depends heavily on ZeroMQ.
    However, having used amavisd-new 2.11 on other distros for quite some time without using ZeroMQ at all this isn't the case. It seems that it is, if anything, only an optional extra. There is apparently no mention of it in the amavisd-new docs. Furthermore, the ZeroMQ module itself is deprecated as of version 0.22 (which was released back in 2012). It seems that ZeroMQ is neither required nor recommended anymore.
  • There are a lot of other dependencies so it makes sense to use the curated cpanfile provided by Openstrike. Note that Mail::SPF 2.9.0 fails its tests if you have Test::POD installed so you will need to force-install that one.


This is, unfortunately, a bit of a chore with a long list of dependencies to install from Slackbuilds or elsewhere. To install inkscape 1.1.2 on Slackware 15 install these prerequisites:

These from the standard packages:

  1. Cython
  2. libsoup
  3. python-pygments
  4. boost

These from Slackbuilds:

  1. OpenBLAS 0.3.12
  2. numpy3
  3. GraphicsMagick
  4. potrace
  5. scour (but maybe not - try without? It needs python2, apparently)
  6. double-conversion
  7. gdl
  8. dos2unix
  9. gspell

Stock kernel upgrades

Instead of simply upgrading a stock kernel and keeping your fingers crossed, it makes much more sense to install the newer kernel and run it alongside the current, working one so that either can be successfully booted - at least until the newer one proves its worth. Here is the process.

  1. Backup everything first: vmlinuz-*,*, config*, initrd.gz, grub.cfg. Take a VM snapshot/image if that's an option.
  2. Un-blacklist the packages temporarily
    $ sudo cp /etc/slackpkg/blacklist{,.bak}
    $ sudo cp /etc/slackpkg/blacklist{.dist,}
  3. Download the new packages
    $ TYPE=huge
    $ VER=5.15.63
    $ OLDVER=$(uname -r)
    $ for p in $TYPE modules headers; do sudo slackpkg download kernel-$p; done
  4. Install them
    $ cd /var/cache/packages/patches/packages/linux-$VER
    $ sudo installpkg ./kernel*$VER*.txz
  5. Backup initrd and make a new one
    $ sudo cp /boot/initrd{,$OLDVER}.gz
    $ sudo perl -pi -e "s/$OLDVER/$VER/;" /etc/mkinitrd.conf
    $ sudo mkinitrd -F /etc/mkinitrd.conf
  6. Update the GRUB config
    $ sudo grub-mkconfig -o /boot/grub/grub.cfg

Now you can reboot. If the new kernel boots and runs fine you can delete the previous ones at your leisure. Don't forget to put the blacklist back again so the packages don't become accidentally upgraded.


These lines in /etc/mkinitrd.conf can be crucial depending on your set-up. Take special care over them.

OUTPUT_IMAGE="/boot/initrd.gz" # This could amend/clobber your existing initrd
KERNEL_VERSION="$(uname -r)"   # Set this to $VER above
KEYMAP="uk"                    # Don't want a US keyboard
MODULE_LIST="ext2:ext4:virtio_blk:virtio_pci" # Amend as necessary
ROOTDEV="/dev/mapper/primary-root" # Be sure to get this right

GRUB config

NB: the default ordering of the kernels is broken in that it chooses all the huge ones before the generic ones. So, to get it to boot the latest generic you will have to amend /etc/default/grub to set GRUB_DEFAULT carefully (and then re-run grub-mkconfig of course).