Automatic Security Updates Tutorial for a VPS
This tutorial shows how to make a VPS install security updates automatically with xyz.sh/autoupdate.
$ curl -fsSL xyz.sh/autoupdate | bash
Details · xyz.sh/autoupdate · Last updated:
Prerequisites
Root access and working package repositories.
CentOS 7 is end-of-life and its repositories may be unavailable.
Steps
Optional: read the source with curl -fsSL xyz.sh/autoupdate.sh and compare xyz.sh/autoupdate.sh.sha256.
Preview: curl -fsSL xyz.sh/autoupdate | bash -s -- --dry-run
Enable: curl -fsSL xyz.sh/autoupdate | bash -s -- -y
Reboot when required: curl -fsSL xyz.sh/autoupdate | bash -s -- --reboot-time 05:30 -y
Status: curl -fsSL xyz.sh/autoupdate | bash -s -- --status
How to verify
Debian/Ubuntu: check /var/log/unattended-upgrades/; Rocky/AlmaLinux: systemctl list-timers dnf-automatic.timer. Or run curl -fsSL xyz.sh/autoupdate | bash -s -- --status.
How to undo or uninstall
curl -fsSL xyz.sh/autoupdate | bash -s -- --disable -y turns auto-updates off (Debian/Ubuntu sets the switches to 0, RHEL-like systems disable the timer); packages are kept.