How can I know if reboot is required after update?

Solution 1:

Check checkrestart from the debian-goodies package. It shows which processes using the old versions of the libs you updated. If you are not able to remove all processes out of that list, you need a reboot :)

Additionally (as YuKYuK said), always reboot after a kernel update!

Solution 2:

cat /var/run/reboot-required.pkgs to see 'service' waiting for a reload. Nothing needs a reboot, only kernel upgrade (and Windows :) ).

Or on Debian: lsof | grep lib | grep DEL

Solution 3:

Just to add to this, I had the same problem with my servers and I wrote an update script where I check /var/run/ like YuKYuK suggested:

test -f /var/run/reboot-required && echo rebooting && sudo reboot