Patching Slackware Linux

Getting ready

BEFORE we proceed, let’s get rid of all the useless .new files

updatedb
locate \.new | grep new$ | grep -v sbopkg
locate \.new | grep new$ | grep -v sbopkg | xargs rm -f

System upgrade

We would like the default behaviour to be (K)eep

slackpkg update
slackpkg upgrade pkgtools slackpkg
slackpkg upgrade-all

(K)eep the old files and consider .new files later

#lilo

In some situation you might also want to check for new packages, however this makes only sense if you have all the sets installed and a full slackware system. As we have minimal custom built bare-metal and XEN guest systems here, we are not gonna do that.

    #slackpkg install-new

Also make sure you still have your favorite python modules in there (in case python got upgraded)

pip list | grep spf
pip list | grep mta
# pip install --upgrade setuptools pip

You might also like to fixup a few symlinks after a major upgrade (those folders may be re-created)

ls -lF /home
ls -lF /var/lib/lxc

Applying new config files

Now let’s have a look for the new config files

updatedb
locate \.new | grep new$ | grep -v sbopkg

for f in `locate \.new | grep new$ | grep -v sbopkg`; do
    diff -bu ${f%\.new} $f | less
done; unset f

check and apply some configs out-of-the-box e.g.

diff -bu /etc/ca-certificates.conf /etc/ca-certificates.conf.new
mv -f /etc/ca-certificates.conf.new /etc/ca-certificates.conf
update-ca-certificates

now check for conflicts

diff -bu /etc/ssh/sshd_config.new /etc/ssh/sshd_config.dist
cat /etc/ssh/sshd_config

and eventually update your customized configs e.g.

vi /etc/ssh/sshd_config
sshd -t && echo OK || echo NOK
/etc/rc.d/rc.sshd restart

Cleaning-up

now clean-up everything that’s left

updatedb
locate \.new | grep new$ | grep -v sbopkg
locate \.new | grep new$ | grep -v sbopkg | xargs rm -f

and re-check

updatedb
locate \.new | grep new$ | grep -v sbopkg

Automated updates

draft - untested

vi /root/WEEKLY

#!/bin/bash

PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin

host="$(hostname)"
date="$(date)"

echo "To: ${MAILTO:-root}"
echo "Subject: Weekly $host $date"
echo ""

# don't do that on -current
/usr/sbin/slackpkg update
/usr/sbin/slackpkg -batch=on -default_answer=y upgrade-all

chmod +x /root/WEEKLY
crontab -e

00 5 * * 0 /root/WEEKLY 2>&1 | /usr/sbin/sendmail -t

Additional notes

Other interesting options

#slackpkg install-new
#slackpkg clean-system

TODO

Consider a link between autoslack and diy conf manager with dsh.

Trash

#locate \.orig | grep \.orig$
#locate \.orig | grep \.orig$ | xargs rm -f

Resources

alternatives

autoslack http://www.slackware.com/~david/zuul/autoslack/