After update Debian (or Ubuntu) using
apt-get update && apt-get -V upgrade
you need to know which services need restart and if system reboot is required (kernel upgrade).
A common workaround was to use checkrestart
(which
included in debian-goodies package) and
/usr/lib/update-notifier/update-motd-reboot-required
(which included in update-notifier-common package).
The package needrestart
Since Debian Jessie (and latest Ubuntu versions
of course), the package needrestart
will do all the
job nice and easy:
Setup needrestart
apt-get install needrestart
needrestart
will run automatically after each
upgrade (apt-get update && apt-get -V upgrade
) and
will inform you with a friendly interface for each situation:
In case some services need restart
needrestart
will display services need restart and
prompt you to enter your choice:

In case system reboot required
needrestart
will inform you that system must be
rebooted (in order to use the new kernel):

In case restart is not needed
After scanning processes and kernel images,
needrestart
will inform you that “No services need to
be restarted” (everything OK)

Run it independently
Of course, you can call it anytime you want to check your system:
needrestart
Entrepreneur | Full-stack developer | Founder of MediSign Ltd. I have over 15 years of professional experience designing and developing web applications. I am also very experienced in managing (web) projects.