Should I always restart the system when I see "System restart required"?

Solution 1:

Should I restart when prompted?

Yes, you should. For most cases, a restart is required when an update to the Linux kernel has been installed. These updates are usually security updates, and then only come into effect after a reboot. Updates to normal applications such as Firefox come into effect after you restart the program. Firefox should prompt you to do this automatically, but other programs may not, so it's something to bear in mind.

How to restart:

To restart the computer in Ubuntu 21.04, click the power icon in the upper right corner of the screen, and select "Power Off/Log out". In the sub-menu that appears, click "Restart...".

  • Where is the restart option?

To restart from the command-line, run this command:

$ sudo reboot

The downsides of restarting:

On the whole, restarting is a very safe operation, and I would not consider it in any way unsafe. Of course, when you restart the computer, you lose all the information in RAM, so make sure you save all open documents and files before shutting down your computer. While you are restarting, your computer will of course be offline for a few minutes. If you're running a server, it will be down for a few minutes. If you have an open SSH session, it will be terminated.

Solution 2:

Should I always restart the system when prompted to?

You may view the list of packages that require a restart with:

more /var/run/reboot-required.pkgs

Based on the list, you can decide whether it is worth restarting.

Example of output:

user@server:~$ more /var/run/reboot-required.pkgs
libssl1.0.0
linux-image-4.4.0-62-generic
linux-base
linux-base
linux-image-4.4.0-63-generic
linux-base
linux-base
linux-image-4.4.0-64-generic
linux-base
linux-base
network-manager
linux-image-4.4.0-66-generic
linux-base
linux-base
linux-base
linux-base
linux-base
linux-base
linux-base
network-manager

(The answer was tested on Ubuntu 14.04 LTS x64 and Ubuntu 16.04 LTS x64)

Solution 3:

  1. How to restart:

    $ sudo reboot
    

    Or

    $ sudo init 6
    
  2. Yes as its most probably a security updates.

  3. Nothing will affect ssh connectivity after restart.