On Debian/Ubuntu servers I enable unattended-upgrades for the security pocket only, with automatic reboot disabled and a notification instead. Feature updates and major versions stay manual. The common failure is not the tool, it is forgetting that a kernel or libc update does nothing until the service or the machine restarts: needrestart (or checkrestart) tells you what still runs old code.
Also worth checking: apt-get -s upgrade weekly, so you see what is waiting.
What is your policy: fully automatic with reboots in a maintenance window, notify-only, or everything by hand? Any horror story with auto-updates?
Open-source agent that lists the versions exposed by a Linux host: https://github.com/AttackScout/attackscout-agent — I work on AttackScout.
Fully automated reboot at 7 am (cause sometimes the boys are still on at 3 and 4). Security only. Manual upgrades and reboots like once every few months when I remember or whatever. Its Minecraft and fluxer nothing mission critical.
a sandbox group that mirrors production and are the only ones to get the updates and tested before your production boxes get the updates – this it the ONLY way that works.
I do nightly automated updates with reboots and have a robust backup system including offsites with borg in case anything goes wrong. So far so good! Remember to test restoring backups regularly.
Before anybody asks: Incremental system backups daily to offsite storage. That said…
Debian and Ubuntu: Automatic unattended upgrades all across the board.
Arch: Full system upgrade every 90 days.
The answers here will depend on whether the server owner has worked on servers professionally or not.
People seem to love overcomplicating this subject but it’s not hard
APT based distros:
apt-get update apt-get upgrade -y rebootEL distros:
dnf update reboot- Use root crontab to schedule, or one of the /etc/cron.[daily|weekly|monthly] dirs. I use a variety of schedules at work - 2nd and 4th Tuesdays of each month. Every day for DMZs. 70 or 80 vms at a time.
Provisos:
- Ensure root email reaches you, so you see any repo or package manager errors from crontab.
- You can wrap this in a bash script. Or use ansible. Add whatever additions you need (notifications, logger lines, shutting stuff down in a particular order - whatever your pets need).
Defences:
- You should have reliable repos already. Remember that dnf can have multiple sources per repo if you want redundancy (We use an internal mirror for speed, but if that does go down, then the vms failover to the internet)
- What about a bad package? It happens, but rare. At scale, ansible with batches and break lines if a certain percentage fail. Use inventory groups to prioritise non-production machines first as canaries)
- Don’t trust a repo source against supply-chain attacks? Then never use their software, let alone add its repo. But you will have to trust your distro. No way around that.
- Critical systems? Then you’re into the realm of soak-testing and staging. Beyond the scope of this, but even there, the actual patching is very similar, just with staged repos instead of live ones. And anyway, critical stuff should be HA.
Benefits:
- Rebooting often means finding problems faster. Your systems should always be able to reboot by themselves. Any failures need to be resolved or automated through. Anyone who is proud of their high uptimes needs taking outside and leaving by the bins.
- Whilst you can check for needsrestart, what’s the point when you can reboot in less than a minute and be certain? Clear those caches and flush those buffers, recover leaking memory and freshen the place up, be 100% certain you’re using the latest kernel and every app has the latest library.
We’ve been doing this for years on hundreds of vms, using Centos Linux, Rocky and Debian distros. Problems caused by reboots are negligible and would have been a problem anyway. Problems caused by bad distro packages are rare - maybe once a year. (I don’t recall any on Debian, but have had the odd one on Rocky and CentOs before it)
Build bouncy systems. Don’t be scared of rebooting.
Fully automatic reboot at 3am if needed. Working well for years and upgrades from debian 6 to 13 so far
I only do security updates automatically and reboot manually when necessary because of full drive encryption. Otherwise it would wait for me to enter the passphrase after an automatic reboot.
fully automatic and automated reboots, I don’t have the patience to babysit servers anymore, and that was more stressful than rewarding anyway
I don’t do unattended. I manually update my server OS, so I know when what changed.
I use a fixed schedule, unless it’s security related.
Same.
Same here. I do daily updates, but I want to have a rough idea which packages got updated. If something breaks, it’s easier to gauge what to roll back. Also, all of my drives are encrypted and (intentionally) require manual unlocking; hence, automated reboots won’t work.
Seems like a lot of work.
I have automatic daily borgbackups and automatic daily updates with pre&post btrfs snapshots, followed by a reboot. If I wake up and my server is down, I can boot into a snapshot via grub and rollback in under a minute (tried and tested).
Or boot into the snapshot and look for evidence what broke.
Worst case I can get a clean drive and restore the borg backup in like 1-2h.
But in practice a Debian/Ubuntu package update will almost never break anything…
Depends on the server. A small vm or lxc in my homelab only reachable from the local network? As needed but at least monthly. Done from an ansible playbook usually in batch.
My cloud vps with several services exposed? Daily auto updates with reboots as needed, also some more checks for some edge cases that broke things in the past (e.g. package update deploys and reloads new SELinux policies but doesn’t require a reboot. Due to the reload of the policies all podman networks fail because their policies are volatile, so podman is instructed to rebuild the network on every auto update that doesn’t require a reboot)
Full unattended-upgrades for my Debian homelab servers (due for replacement) because I don’t care about downtime and it has never broken anything. Manual updates for my personal NixOS server (that I’m also about to replace) because I never set up automatic updates. Weekly manual updates for a production Ubuntu server (that’s hopefully about to get axed) because whoever set it up and was supposed to be maintaining it before was an idiot so updates need to be planned carefully.









