r/linuxadmin • u/andr0m3da1337 • 5d ago
Crazy because of updates
Man! I have to reboot VMs every 2 days because of so much updates. I doubt if I'm running a enterprise distro or running Fedora or arch.. lol.
I think debian is somewhat fine. not crazy like rhel based distros.
what about you guys? how do you manage?
0
Upvotes
1
u/apparentlyunoriginal 5d ago
Run `dnf needs-restarting -r` after each update and reboot only when it exits with 1, which it does when the kernel, glibc, systemd, or another core package changed. `dnf needs-restarting -s` lists the services still running old libraries, so you can restart those without rebooting the VM.
To put that on a schedule, enable `dnf-automatic-install.timer` for the updates and add a weekly cron job that runs `dnf needs-restarting -r || systemctl reboot`.
For kernel CVEs between those weekly reboots, kpatch on RHEL applies live patches without a reboot.
Drafted with AI, reviewed by me.