↑ ↓ select, Enter open, Esc close

Check whether a reboot is required after updates

user@server
if [ -f /var/run/reboot-required ]; then cat /var/run/reboot-required.pkgs; else echo "Kein Neustart vermerkt"; fi

Checks 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

Related one-liners

All in Debian and APT

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.