Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

I often install packages and updates for them, although sometimes it is not convenient to do a reboot if one of the packages needs it, so is there any way of telling BEFORE installing the package/update whether or not it will require you to do a reboot? I have already looked here and the solutions there don't solve my problem, nor the more or less same one described there.

share|improve this question

1 Answer 1

up vote 6 down vote accepted

There's no flag of sorts on packages that indicate that a reboot is required if the package is installed or updated. So, short answer: you can't.

However, you could extract the .deb files of the package before installing or updating to see if a reboot notification is made in the DEBIAN/postinst script. For example, the postinst script in the linux-image-*.deb packages execute the /usr/share/update-notifier/notify-reboot-required script, which in turn creates the /var/run/reboot-required file. Other postinst scripts may use the same method to indicate a necessary reboot, but there's no enforcement of a default method of getting to the creation of the /var/run/reboot-required file. It might be that a package is maintained by someone who isn't really into doing things like other maintainers do, and decides that the reboot notification can also be done in another script, like DEBIAN/preinst. So, long answer: you can, but it'll be a real nightmare to implement and maintain a way to detect all possible reboot notifications.

share|improve this answer
Good answer. I would have described it similarly. – A.B. Sep 17 at 4:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.