When is it necessary to reboot an Ubuntu system?

7,673

Solution 1

  • After kernel panic;
  • After partitioning or filesystem modifications (more specifically, resizing root partition; I'd recommend to avoid resizing the hard drive from which you boot in general, regardless of partition; if you are resizing something external, like SD card or USB, no reboots necessary );
  • After kernel upgrade and security patches (although that [might not always be necessary];
  • After system became unresponsive for whatever reason, and you've no option but to use magic SYSRQ keys or hard reset
  • After making changes to some dconf schemas , depending on the way application may have been developed. Related answer
  • Your CPU is overheating (you don't wanna keep on roasting those cores, do you ?)

Solution 2

There are generally two situations where a reboot is usually necessary:

  1. The kernel is upgraded.
  2. libc (rather, glibc) is upgraded.

There is a mechanism for reloading the kernel without restarting (How can I upgrade my server's kernel without rebooting?). With glibc, the biggest problem is init. It is possible to restart init (see Restarting init without restarting the system).

For the average user, neither is recommended, and restarting is necessary.

Apparently, there exists a third case:

  1. dbus has been upgraded. dbus-daemon is apparently incapable of restarting (from what I can understand of the discussion on this LWN article). And since a lot of things rely on DBus...

Solution 3

Actually, it depends what you're trying to accomplish:

  • If you do an apt-get dist-upgrade and a new kernel comes in, and you want to activate it, you need a reboot.

  • If a new version of FireFox comes in, you obviously don't.

And in between those two extremes are 50 shades of grey:

enter image description here

;-)

Solution 4

I can't think of any situations of where a reboot is absolutely necessary.

Really, you can leave Ubuntu running indefinitely. It might get malware (because kernel and libc updates aren't applied) and it might panic or crash out... But what are avoiding those actually going to do for you?

Given the complexities of life, it might be more necessary to ignore the constant demands of computers, and sustain yourself in other ways. Like breathing, eating, loving... living.

But even then, are they absolutely necessary? Is your existence on this plane within the absolute definition of necessity? I honestly don't know. Bit of a weird question to ask.


To the two big-fat-joke-spoilers who downvoted this post and those that follow,

This question was incomplete, or at least open-ended. When you throw around words like necessary, you need to give a context.

Many answers already assumed the OP meant highly desirable (in a technical sense), so posted answers that fit contexts like necessary to avoid being hacked or necessary if your computer crashes. They're good answers. Adding another wasn't really warranted.

But they say assumptions are the mother of all muck ups (or something like that anyway) so I peeled it back to absolute necessity. If you insist on using an old copy of 10.10, Time and Space will carry rolling on, as are their wonts.

You'll note I'm not recommending that position.

Solution 5

I actually had a situation earlier today that proves this. Sometimes, there are residual things left over in the system after a change is made. For example, I had a user that was not able to access /dev/dsp despite having been added to the appropriate groups. There was a lock placed on it by the first user that accessed it. However, even after killing that user, the lock was still in place and the second user could not access it. However, after a reboot, both users were able to simultaneously use /dev/dsp without any conflict. Doing a reboot releases any residual things that could prevent changes from properly taking effect.

Share:
7,673

Related videos on Youtube

A.B.
Author by

A.B.

ZX81, C64, DR-DOS, OS/2, Linux Talk with me in Ask Ubuntu General Room profile for A.B. on Stack Exchange, a network of free, community-driven Q&A sites http://stackexchange.com/users/flair/186154.png

Updated on September 18, 2022

Comments

  • A.B.
    A.B. almost 2 years

    Under what circumstances is a reboot of an Ubuntu system necessary? I often read in answers that after changes in the system the system is to be restarted, but is that absolutely necessary?

  • A.B.
    A.B. almost 9 years
    Indeed 50 shades :)
  • Admin
    Admin almost 9 years
    Yes, because killing the oss process that I was working with has been shown to leave it in a somewhat inconsistent state where it does not always work afterwards.
  • Terrance
    Terrance almost 9 years
    This 50 Shades response is awesome! :)
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy almost 9 years
    Agreed. It's always better to stay on the safe side
  • Byte Commander
    Byte Commander almost 9 years
    +1 and a broad smile for preferring eating over rebooting! :D
  • UTF-8
    UTF-8 almost 9 years
    Why would you need to reboot Ubuntu after partitioning?
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy almost 9 years
    @UTF-8 Typically, it's recommended to partition an unmounted filesystem to prevent data loss. So, if you were to partition your hard drive, you'd need to insert live USB/DVD and reboot; when you done partitioning, reboot back to hard-drive.
  • UTF-8
    UTF-8 almost 9 years
    Yes, but then rebooting is something you do anyways. If you partition something the system doesn't depend on (data partition, thumb drive, SD card, external HDD, file container, whatever), you don't need to reboot. I didn't reboot when I made a new partition table for 2 devices 2 hours ago.
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy almost 9 years
    @UTF-8 I guess I should have been more specific in my answer. Will get that fixed in a second :)
  • muru
    muru almost 9 years
    You don't need to reboot after resizing the root partition.
  • Wilf
    Wilf almost 9 years
    With the partitioning thing, sometimes gparted etc says 'can't inform the kernel plz restart'
  • Rinzwind
    Rinzwind almost 9 years
    "Your CPU is overheating (you don't wanna keep on roasting those cores, do you ?)" I do not see it as "necessary" to reboot if you are stress testing a cpu ;) There are always exceptions. I still claim that after a new install it is necessary. All others are optional (and yes also advisable!) but not necessary.
  • Sergiy Kolodyazhnyy
    Sergiy Kolodyazhnyy almost 9 years
    @Rinzwind I am drawing this example from experience: about two - three weeks ago my CPU was overheating, got close to 95 degrees Celsius at one point. I minimized the number of processes, but it still wasn't helping. So I had to bring my system down, add thermal paste to the CPU, and start my laptop again. I'd say reboot is always necessary when you have no software solution to an issue. Linux kernel is famous for uptime, but at the end of the day it's still just a kernel, not a perpetual motion machine. And we have to consider hardware,too
  • A.B.
    A.B. almost 9 years
    Why if I have changed dconf schemas? Is this really a reason?
  • retrixe
    retrixe over 8 years
    @A.B. It depends mainly on the application. I have never had to, since I have never changed dconf schemas that much, but it is possible that in some system applications, you will need to reboot to see changes.
  • retrixe
    retrixe over 8 years
    Malware? Come on, kernel updates and libc updates have nothing to do here. Okay, maybe kernel could play a part, but it all depends on the internet, and also, Linux has a much less risk of getting infected. Ubuntu has auto-updates too. Linux is super stable too, but I agree that there is a risk. Otherwise, Kudos.
  • Eliah Kagan
    Eliah Kagan almost 7 years
    "There are scenarios where it is recommended, like after the install of a new desktop." Wouldn't logging out and back in be sufficient for that case?
  • cl-netbox
    cl-netbox almost 7 years
    @EliahKagan Yes, generally it of course should be sufficient to logout and back in when you install a new desktop environment, but I have seen many cases where something went wrong and that's why I said, it's recommended. :)