28
submitted 7 hours ago by attackscout@lemmy.world to c/linux@lemmy.ml

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.

top 11 comments
sorted by: hot top new old
[-] non_burglar@lemmy.world 3 points 2 hours ago

The answers here will depend on whether the server owner has worked on servers professionally or not.

[-] digdilem@lemmy.ml 6 points 3 hours ago* (last edited 3 hours ago)

People seem to love overcomplicating this subject but it's not hard

APT based distros:

apt-get update
apt-get upgrade -y
reboot

EL 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.

[-] elvith@feddit.org 1 points 3 hours ago

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)

[-] JoeKrogan@lemmy.world 12 points 6 hours ago

Fully automatic reboot at 3am if needed. Working well for years and upgrades from debian 6 to 13 so far

[-] bjoern_tantau@swg-empire.de 4 points 5 hours ago

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.

[-] eager_eagle@lemmy.world 6 points 6 hours ago* (last edited 6 hours ago)

fully automatic and automated reboots, I don't have the patience to babysit servers anymore, and that was more stressful than rewarding anyway

[-] Strit@lemmy.linuxuserspace.show 6 points 7 hours ago

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.

[-] LewdLemon@sh.itjust.works 1 points 5 hours ago

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.

[-] HelloRoot@lemy.lol 1 points 1 hour ago* (last edited 1 hour ago)

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...

[-] sudoer777@lemmy.ml 2 points 6 hours ago* (last edited 6 hours ago)

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.

this post was submitted on 04 Dec 2026
28 points (100.0% liked)

Linux

69006 readers
747 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS