Skip to content

Did you know?

On Ubuntu, the file /var/run/reboot-required tells you an update needs a reboot.

reboot-required.pkgs next to it lists the packages that asked for it.

Explained

Kernel, glibc and some other updates only take effect after a restart. On Ubuntu, packages that need one create the file /var/run/reboot-required. That is also where the “*** System restart required ***” line in the SSH login message comes from.

ls /var/run/reboot-required*
cat /var/run/reboot-required.pkgs
/var/run/reboot-required  /var/run/reboot-required.pkgs
linux-image-6.17.0-8-generic
libc6

Use it in scripts and automation, for example to reboot during a maintenance window only when needed:

[ -f /var/run/reboot-required ] && echo "Reboot needed"

Unattended upgrades can reboot automatically when this file appears, if you set Unattended-Upgrade::Automatic-Reboot "true"; together with a Automatic-Reboot-Time in /etc/apt/apt.conf.d/50unattended-upgrades.

Learn more

← All tech tips · Suggest a fix

Back to top