Patching Slackware Linux

Requirements

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

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

System upgrade

screen -ls
screen -S UPGRADE
slackpkg update
slackpkg upgrade pkgtools slackpkg && slackpkg update
slackpkg upgrade-all

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

fdisk -l
disk=/dev/sda
disk=/dev/nvme0n1

fdisk -l $disk | grep ^Disklabel
lilo
#slackpkg clean-system
sbopkg -r

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

pip list | grep spf

in case you also need to upgrade those

#pip install --upgrade pip setuptools
#pip list --outdated
#pip list --outdated --format=freeze | cut -d= -f1 | xargs pip install --upgrade
#pip list --outdated

you might also like to fixup a few symlinks after a major upgrade (those folders may have been re-created)

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

Applying new config files

etcupdate for slackware

assuming you tuned logrotate already

either go for our automation script

cd /usr/local/sbin/
wget https://pub.nethence.com/bin/slackupdate.bash.txt
mv slackupdate.bash.txt slackupdate.bash
chmod +x slackupdate.bash

slackupdate.bash

–or– proceed manually as follows

let’s have a look for the new config files

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

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

Automated updates

in your daily cron job

vi /root/DAILY

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

and eventually use the script (mentioned above) to partially automate the update of the /etc/ folder

Resources

Upgrading Slackware to a New Release https://docs.slackware.com/howtos:slackware_admin:systemupgrade

slackpkg https://docs.slackware.com/slackware:slackpkg

alternatives

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

pip

How to upgrade all Python packages with pip https://stackoverflow.com/questions/2720014/how-to-upgrade-all-python-packages-with-pip

How To Update All Python Packages https://www.activestate.com/resources/quick-reads/how-to-update-all-python-packages/


HOME | GUIDES | LECTURES | LAB | SMTP HEALTH | HTML5
Copyright © 2022 Pierre-Philipp Braun