Check whether a reboot is required after updates
does the server need a reboot | system restart required ubuntu | reboot needed after kernel update | reboot | updates | kernelif [ -f /var/run/reboot-required ]; then cat /var/run/reboot-required.pkgs; else echo "Kein Neustart vermerkt"; fiChecks whether the file /var/run/reboot-required exists, and if so, prints the packages from reboot-required.pkgs that triggered the reboot. Typical ones are the kernel, libc6 or systemd. If the file does not exist, a corresponding message appears.
Note: On Debian, not all packages create this file. needrestart is more reliable there, see the entry on services using outdated libraries.
Open question before approval: Unter Debian 12 wird /var/run/reboot-required nicht von allen Paketen angelegt (unter Ubuntu zuverlässig über update-notifier-common). Auf Debian prüfen, ob die Datei nach einem Kernel-Update entsteht, sonst needrestart empfehlen.
Also searched as
- does the server need a reboot
- system restart required ubuntu
- reboot needed after kernel update