I have a lot of updates, but I just want to install the ones that don't need a system restart. How do I do this? The command-Line solution is preferred, but GUI is fine.



All current versions of Ubuntu contain nice utility named needrestart:

check which daemons need to be restarted after library upgrades

It registers itself to react on apt install or remove triggers.

Install it with:

sudo apt-get install needrestart

And it will inform you about needed restart after package installation.

  • It won't show which of the updates I have that need a restart. For example, I have a kernel update that needs a restart. The kernel packages don't show up on the list.
    – Aten
    Nov 19 '20 at 16:35

Your question makes sense for somebody coming from the Windows way of operating...but Ubuntu does not work the same way: Most users do not need to distinguish between restart-required vs. other upgrades.

An immediate restart is never required by your Ubuntu system. You can install all upgrades now, and restart sometime in the future. This is obviously very different from how Windows Updates work.

Restarts are generally required only by kernel packages. If you choose not to restart, you will simply continue to keep using your current kernel.

Updated kernel packages are released every few weeks. Many folks have servers that run months between restarts. At the restart, the server boots into the newest kernel, skipping over many intermediate kernels that never run. The system automatically deletes older kernels afterward.

On occasion, a kernel upgrade will include important security patches. Unattended Upgrades will install these automatically, and without asking you first. However, the system still WON'T reboot into that new kernel. (There is a setting that permits Unattended Upgrades to reboot without asking...but it's OFF by default).

Advanced Service: You can reduce the number of restart-requiring updates by using Livepatch

  • There's something I've wanted to ask for a while ...I've always wondered if you upgraded your kernel and it's asking to restart but you don't restart for a "long" time (because other users are being stubborn and won't let you restart it...), is there any harm at all? I guess by this, I mean if it is on the old kernel X, will it ever read files from disk which are for a newer kernel Y and somehow mixing the two up, causing a crash? Or if it's on version X, it has read all it needs from disk and won't go on Y until the next reboot?
    – Ray
    Nov 19 '20 at 7:41
  • @Ray the short answer is that it's really good about keeping X and Y straight. It won't go to Y until the next reboot. If using Livepatch, it's slightly fuzzier: It's still X, but some elements of Y might seep in. The system does not find that confusing -- only humans do.
    – user535733
    Nov 19 '20 at 14:15
  • I see! Thank you!! I do update servers regularly but since other users are always logged in, I rarely have an opportunity to do a restart. When I ssh in, I always see that message about the system needing a reboot and I always feel "pressured"... Good to know that this pressure is all in my head! :-)
    – Ray
    Nov 19 '20 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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