Automated system maintenance scripts for Slackware-current: unattended package update downloads via slapt-get, multilib update checks, and the helpers they share. Installing the downloaded updates is a separate, manual step (UpdateAll).
| File in repo | Install to | Purpose |
|---|---|---|
etc/cron.daily/121-slaptgetupdate |
/etc/cron.daily/ |
Downloads available system updates with slapt-get |
etc/cron.daily/120-mulitlibsupdate |
/etc/cron.daily/ |
Checks the Alien multilib mirror for updates |
etc/crontimerloop.sh |
/etc/crontimerloop.sh |
Retry-with-timeout helper, sourced by 120 and 121 |
etc/windowlabelandmove.sh |
/etc/windowlabelandmove.sh |
Opens the download folder in a file manager for the logged-in user |
var/slapt-get/UpdateAll |
your slapt-get WORKINGDIR |
Manual script: installs the downloaded updates |
var/slapt-get/OrphanDeps |
your slapt-get WORKINGDIR |
Manual script: finds and offers to remove packages dropped from -current |
customtoolsrootloc/sbin/upgradepkg/upgradepkg |
${customtoolsrootloc}/sbin/upgradepkg |
Customised upgradepkg, restored after a pkgtools update |
WORKINGDIR is the value set in /etc/slapt-get/slapt-getrc (for example /var/slapt-get).
- slapt-get: Slackware package manager extension for dependency handling and updates. Installation and info: https://github.com/jaos/slapt-get
- lftp: used by
120-mulitlibsupdateto mirror the multilib repository. - wget: used by
OrphanDepsto fetch the Slackware-current ChangeLog. - timeout (coreutils), runuser (util-linux) and xdg-open (xdg-utils).
- bash: all scripts, including the helper when sourced, expect bash.
- needrestart:
UpdateAllrunsneedrestart -r aafter installing, if it is present. Installation and info: https://github.com/liske/needrestart - wmctrl: only used by
windowlabelandmove.shin unsafe mode, to move the window to a workspace. SlackBuild: https://slackbuilds.org/result/?search=wmctrl&sv= Alternative / upstream: https://github.com/dancor/wmctrl
Run daily by cron. It downloads updates only; nothing is installed.
- Runs
slapt-get --update(600 second timeout, 3 attempts), thenslapt-get --upgrade --ignore-dep --download-only(1800 second timeout, 3 attempts) intoWORKINGDIR. - Handles:
- Sources that fail to update: they are disabled in
slapt-getrcfor the run, the update is retried, then they are re-enabled. - MD5 mismatches: the offending source is disabled for the run.
- HTTP download errors: the package is excluded for the run and the upgrade is retried.
- Timeouts: sources and exclusions are restored and the script exits 1.
- Sources that fail to update: they are disabled in
- After downloading it checks for a new
pkgtoolsand, if one is installed, puts your customisedupgradepkgback. It also removes anopenjdkdownload that is not newer than the installed Java, and prints a note when a newermozjsis available. - Writes
FileListand opensWORKINGDIRin the file manager (seewindowlabelandmove.sh) when there is something to install.
Warning: at the start of every run the script empties WORKINGDIR, keeping only UpdateAll, OrphanDeps and 32multi. Use a directory dedicated to slapt-get. The script refuses to run if WORKINGDIR is missing, empty, or /.
User variables at the top of the script:
customtoolsrootloc="/SETAPATH_NO_TRAILING_SLASH" # where your custom sbin/upgradepkg lives
windowtomoveto="4" # workspace number, counting from 1Run daily by cron, before 121.
- Mirrors
https://slackware.nl/people/alien/multilib/(current) intoWORKINGDIR/32multi/withlftp(1200 second timeout, 3 attempts). - Compares
current/PACKAGES.TXTwith the previous copy (PACKAGES-OLD.TXT). If it changed, it creates/tmp/multilib_updates, opens the file manager and prints "Multilib updates to install". WORKINGDIR/32multi/current/PACKAGES.TXTmust already exist, so seed it with one manual mirror run before the first cron run.
Sourced by 120 and 121. Provides:
ctl-fn_timeoutloop <name> <timeout_seconds> <max_attempts> <command...>- Runs the command under
timeout, streaming its output while also capturing it. - Exit codes:
0success,124timed out on every attempt, anything else is the command's own exit code (no retry). - Prints
ERROR: <name> ...to stderr on failure. A caller that handles the failure itself should capture stderr (2>&1), as 121 does. - Optional hooks, called if you define them:
on_timeoutandon_failure.
Sourced by 120 and 121. Call it with windowtomoveto and wintomv set:
windowtomoveto="4"
wintomv="/path/to/package/dir"
. /etc/windowlabelandmove.sh
wlm-fn_windowlabelandmove- Safe mode (default,
unsafemode=0): openswintomvwithxdg-openas each logged-in user. It does not move the window. - Unsafe mode (
unsafemode=1): opens the window as root and moves it to workspacewindowtomovetowithwmctrl. This puts root-owned windows on users' desktops, so only enable it if you accept that. - Needs a running X session. It fails silently if there is none.
Run manually as root from WORKINGDIR after cron has downloaded updates.
- Upgrades the packages in
32multi, moves everything else downloaded intoslackware64/, and installs it withupgradepkg -ir. - Then runs
./OrphanDeps, andneedrestart -r aifneedrestartis installed.
Run manually (also called by UpdateAll). Interactive.
- Downloads the Slackware-current
ChangeLog.txtand lists installed packages that it marks as removed. - Asks
[y/N]before removing anything, usingslapt-get --remove. - Packages named in
EXCLUDE_LIST(package name only, no version or build) are never removed:
EXCLUDE_LIST=(
"exluded-pkg1"
"exluded-pkg2"
)A customised copy of Slackware's upgradepkg with quality-of-life changes the stock version does not have. A pkgtools update replaces /sbin/upgradepkg with the stock one, so when 121 installs one it saves the new file as ${customtoolsrootloc}/sbin/upgradepkg-new and copies your custom ${customtoolsrootloc}/sbin/upgradepkg over /sbin/upgradepkg.
- 120 and 121 are designed for unattended cron use. The window and workspace behaviour needs a running X server.
- 121 temporarily edits
/etc/slapt-get/slapt-getrc(SOURCE=andEXCLUDE=lines) and restores it at the end. If a run is killed part way through, check the file for leftover#DISABLED=lines or an extendedEXCLUDE=. - The scripts use
set -euo pipefail, so an unexpected failure stops the run.
2026-10-31
- README rewritten to match the files actually in this repo. Removed the
perthingsandpipthingssections and the Perl, pip andxdotoolprerequisites (those scripts are not included). Added documentation for 120, the helper,windowlabelandmove.sh,UpdateAll,OrphanDepsand the customupgradepkg. Corrected thewmctrldescription (unsafe mode only). etc/crontimerloop.shrestored to the retry helper (it had been overwritten by an unrelated drive-check script).121-slaptgetupdate: refuses an empty, missing or/WORKINGDIR; no longer aborts whenUpdateAll,OrphanDepsor32multiare absent; timeouts now stop the run and restoreslapt-getrcinstead of being ignored.
MIT License. See the LICENSE file for details.