# How to determine whether I need to restart due to upgrades on Ubuntu?

When I use apt to update my system (e.g. run sudo aptitude full-upgrade) it sometimes installs updates that require reboots. This applies esp. for kernel (security) updates.

I can sometimes see this in the ssh login message. I'm wondering how (else) I may determine whether the system needs a reboot due to these updates.

-

The MOTD "restart required" text is generated by /usr/lib/update-notifier/update-motd-reboot-required, which checks for the existence of and pulls text from /var/run/reboot-required:
#!/bin/sh -e