Check if a reboot is required after updates

Read the reboot-required flag that tells you the running kernel or libraries are outdated.

LinuxupdatesrebootsecurityaptMedium risk
Run the check above — if /var/run/reboot-required exists, the listed packages won't be active until you reboot.

01Command

Command
$ [ -f /var/run/reboot-required ] && cat /var/run/reboot-required || echo 'No reboot required'

02What it does

On Ubuntu and Debian, package updates that replace the kernel or core libraries drop a flag file at /var/run/reboot-required listing the affected packages. Until you reboot, you're still running the old code even though the new packages are installed — a common reason a 'patched' server is still vulnerable. Servers often check this in cron or a login banner so admins see it immediately.

03Risk

RiskMedium risk
!Warning: This flag only appears on Debian/Ubuntu-family systems; check running vs installed kernels with uname -r and dpkg -l linux-image if in doubt.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • UnattendedUpgrades — Debian Wiki
    Debian · community · 2026-09-17
    Evidence: Kernel and library updates only take effect after a reboot; Debian/Ubuntu flag pending reboots via /var/run/reboot-required.
  • unattended-upgrade(8) — Ubuntu manual page
    Ubuntu · community · 2026-09-17
    Evidence: After installing updates the tool records packages that require a restart in the reboot-required flag file.

Last verified: 2026-09-18 · Category: Security & Privacy

06Related solutions