Ubuntu – How to make a deb file which tells the system a reboot is required

debpackage-managementpackaging

I plan to set up a PPA or perhaps submit my package to Debian, but there is something I really need to know, I understand that packages normally do something with /var/run/reboot-required and are listed in /var/run/reboot-required.pkg, but how exactly does one create a deb file which tells the system through that method that a reboot is required to make all the necessary changes? Is there simply a flag I need to set in one of the files or is it more manual than that? I am running Ubuntu GNOME 16.04 with GNOME 3.20.

Best Answer

If you do need a reboot after installation you will make a call to /usr/share/update-notifier/notify-reboot-required in the .postinst script for your package. This can easily be found be reading the .postinst script of any linux-image package.

However, I would be concerned about any custom PPA that requires a reboot after installation.

Other than kernel updates, there are few packages that require a reboot. There are important libraries that may required certain services to be restarted.

If your install script requires the service it installed to be restarted, it should perform the restart as part of the post installation procedure. This is normally the case for daemon processes.

Many packages don't require any restart at all.

Related Question