Check if a reboot is required after updates
Read the reboot-required flag that tells you the running kernel or libraries are outdated.
01Command
$ [ -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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- UnattendedUpgrades — Debian WikiEvidence: 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 pageEvidence: 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
Generate a modern Ed25519 public/private key pair in ~/.ssh for authenticating to servers and Git platforms without passwords.
Add or remove read, write, and execute permission for the owner, group, or others using symbolic or octal modes.
autoremove deletes no-longer-needed dependency packages, and clean wipes the downloaded .deb cache in /var/cache/apt/archives.