Why does Ubuntu need to reboot so often?

9,455

Solution 1

I guess you are referring to the latest update.

It included a package called linux-firmware which is a package that provides firmware used by the Linux kernel drivers so it was a kernel related update.

So to answer your question or better to correct that statement, Ubuntu doesn't need to be restarted on every update but just on updates which are related to kernel stuff.

Solution 2

I'm not sure of all the packages that require a reboot to finish the upgrade, but it is easy to find out why in specific cases.

The warning is triggered by a postinst script in the package. It creates the file /var/run/reboot-required The file /var/run/reboot-required.pkgs will list the packages that require the reboot.

Solution 3

It's worth saying that Linux also needs rebooted after other package updates too.

I'm a big Ubuntu fan but the frequency of package updates (because it's so bleeding edge) is far higher than other distributions.

The extent of which has meant I've dropped Ubuntu on some Servers in favour of Debian.

If anyone else can add to this list of packages that need a reboot it would be appreciated.

I use the superb checkrestart from debian-goodies (it uses lsof) to check when older libraries are still in use.

Updating these packages force a reboot:

Kernel packages (not all, like the meta packages) libc dbus

I'm only really concerned with Ubuntu Server and not the Desktop because only rebooting my Servers gives me a headache!

Solution 4

If you don't want to, here is a solution for desktop Linux use: http://www.ksplice.com

Share:
9,455

Related videos on Youtube

Admin
Author by

Admin

Updated on September 18, 2022

Comments

  • Admin
    Admin almost 2 years

    Ubuntu seems to require a reboot after almost every apt update, even those that do not include a new kernel version. Why?

    • sazary
      sazary over 13 years
      I think you can improve the quality of your question by adding the list of packages involved in one of your updates. it makes the discussion more specific.
    • Admin
      Admin over 13 years
      @ahm: Yes, I realised that. I noted on the accepted answer that I'll try to keep track of the packages before I complain again.
  • Admin
    Admin over 13 years
    Bleeding Edge? Lots of packages from the Debian repositories that I'm interested in are years out-of-date.
  • Nerdfest
    Nerdfest over 13 years
    If rebooting that often is a problem for you, a package called ksplice is usable free in Ubuntu. It allows the kernel to be patched on the fly. Very impressive.
  • Admin
    Admin over 13 years
    @Nerdfest: I just hibernate or suspend my laptop, so every reboot is a nuisance. I hadn't heard of ksplice -- thanks.
  • Jonathan Ross
    Jonathan Ross over 13 years
    I was referring to other distributions too, not just Debian-based flavours. The package versions in Ubuntu are far newer than most others which makes them less proven and more prone to updates.
  • cokeman19
    cokeman19 over 13 years
    @Tim: Read again, he wrote "bleeding edge" in regards to Ubuntu.
  • Admin
    Admin over 13 years
    @Adam: Ubuntu uses the Debian repositories AFAIK. s/Debian/Ubuntu/ ín my comment if you want to.
  • cokeman19
    cokeman19 over 13 years
    @Tim: I think he meant the release cycle, but to be honest the answer is a bit difficult to comprehend.
  • user1974
    user1974 over 13 years
    This answer is great. Thanks jonathan! Even though you didn't get selected, your answer is more correct. The kernel is not the only package that requests/requires a reboot.
  • Nerdfest
    Nerdfest over 13 years
    As a warning, if you hibernate with an upgraded kernel, you will lose your state. I think suspend is okay though.
  • datacarl
    datacarl over 13 years
    You only need to reboot for the updates to take effect. For users who restart daily, there isn't much sense in a premature reboot.
  • Admin
    Admin over 13 years
    @Jonathan Ubuntu isn't bleeding edge; 95% of packages are out-of-date in Maverick, and 70% are out-of-date in Natty. Fedora is bleeding edge, with 70% out-of-date packages in 14 and 55% out-of-date in 15-alpha. Ubuntu just has a fast and consistent release cycle.
  • Admin
    Admin over 13 years
    @user1974 System services can be restarted without rebooting (e.g. Apache2, OpenSSH). APT just sets the reboot-required flag (/var/run/reboot-required) for packages that affect system services or libraries.
  • TRiG
    TRiG almost 13 years
    No, probably not.
  • stephenmyall
    stephenmyall almost 12 years
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes.
  • Vadim Peretokin
    Vadim Peretokin almost 12 years
    That's a fair point.
  • jpp1
    jpp1 almost 5 years
    I am not sure this really answers what I find odd: in the past, ubuntu did not require reboots even with kernel updates. I had Ubuntu running for months, installing each and every update. Now, I have to reboot every few days. Is there no way to update and not constantly reboot? Is just doing this safe?