Score:1

Ubuntu requires a reboot way too often

ru flag

The automatic updates ask me to reboot my Ubuntu at least twice a week. Sometimes I postpone the reboot for a few days, then I reboot it, the system installs new updates and asks for a reboot immediately after.

I haven't been checking what exactly needs restarting. I noticed that the system firmware is updated fairly often, perhaps too often for a firmware, but that still only accounts for a minority of the cases.

I remember not so long ago that I was able to run my system for weeks and months without a restart, so this definitely does not feel right.

I'm running Kubuntu 21.10. These are my repositories:

http://cz.archive.ubuntu.com/ubuntuimpish-backports/universe
http://cz.archive.ubuntu.com/ubuntuimpish/main
http://cz.archive.ubuntu.com/ubuntuimpish/multiverse
http://cz.archive.ubuntu.com/ubuntuimpish/restricted
http://cz.archive.ubuntu.com/ubuntuimpish/universe
http://cz.archive.ubuntu.com/ubuntuimpish-updates/main
http://cz.archive.ubuntu.com/ubuntuimpish-updates/multiverse
http://cz.archive.ubuntu.com/ubuntuimpish-updates/restricted
http://cz.archive.ubuntu.com/ubuntuimpish-updates/universe
http://dl.google.com/linux/chrome/debstable/main
http://security.ubuntu.com/ubuntuimpish-security/main
http://security.ubuntu.com/ubuntuimpish-security/multiverse
http://security.ubuntu.com/ubuntuimpish-security/restricted
http://security.ubuntu.com/ubuntuimpish-security/universe

My question is whether I can do something about it or whether it is basically a "bug" that I should report somewhere.

Organic Marble avatar
us flag
Suggest you start tracking `/var/run/reboot-required.pkgs` to see what's causing it. My experience has not been yours - my systems require a reboot for new kernels, maybe every 10 to 14 days. They have never gone "months". My all time uptime record since I started using Ubuntu with 12.04 is 46 days. 12/2/19 to 1/17/20 on an 18.04 system
cn flag
"Ubuntu requires a reboot way too often" no it does not. Rebooting is optional :-)
user535733 avatar
cn flag
@24601 Ubuntu 21.10 stopped being a "development" version when it was released.
ChanganAuto avatar
us flag
Maybe the "backports" repository is causing it. Do you really need it?
ru flag
Disabled it, let's see if that helps, thanks! :)
Marc Compere avatar
za flag
I agree. Ubuntu should not request a reboot so often. Anything more than once every few months is way too much. Maybe Debian would ask less.
Score:1
in flag

If you run updates manually before rebooting, it should not require another reboot afterwards. It would only require another reboot if there was another update pending that was installed after you rebooted.

The most likely reason a reboot is needed is to switch to the newly installed kernel brought in by the update. For almost all other updates, affected services can be restarted without rebooting.

Most of the time, you can ignore this and not reboot; but be aware that if you don't reboot, you will be running the older kernel which may have security holes that are fixed in the newer kernel.

Note that because you are running a non-LTS version of ubuntu, there may be even more updates, so this would require reboots more frequently.

If you are super keen on not rebooting and were running an LTS version of Ubuntu, you could try the live patch service which tries to upgrade the in memory kernel without rebooting. But this very occasionally fails and you still need to reboot.

Note also that as long as you are aware of the consequences of not rebooting, it is possible to just turn off the reminder.

user10489 avatar
in flag
Note also one exception to the above is nVidia drivers, which have to be updated in lock step with the nVidia interface library. So once the library is updated, the driver must be updated for new applications to talk to the gpu. The driver typically can't be updated live because it is in use, so a reboot is necessary. Not sure how livepatch handles that.
ru flag
Is there any way to get more detailed info on the reboot requirement? I.e. whether actual reboot is needed or just re-login is enough, whether there is an important security patch pending etc... Right now it's just an indicator in KDE's systray which doesn't say anything, it just sits there being annoying :D
user10489 avatar
in flag
As another commenter indicated, check `/var/run/reboot-required.pkgs` ; also look at files in `/var/lib/update-manager/` . I'm not sure if there is something on the system that indicates which ones are security updates, but there are security blogs that typically list those, and you can read through the relevant CVEs and decide for yourself if you care.
ru flag
Why I'm not so fond of frequent reboots is because they break my workflow (I need to close all my apps) and they take time (especially with the extra step caused by disk encryption). I'm talking about a personal computer, not a server. So checking a security blog is definitely not what I'd call a solution here :)
user10489 avatar
in flag
Part of a proper risk assessment is balancing fixing issues (disruption to your work flow by rebooting) against risks (your desktop getting hacked; information on your desktop leaking to internet or getting destroyed) and the likelihood of those risks (is your system on internet? is it firewalled externally?). If the risks or the likelihood of the risks is low enough, perhaps rebooting can be done once a week or once every several weeks or not at all.
ru flag
My hope is that a user-friendly distro like Ubuntu would help me with this balancing and offer reasonable defaults. Rebooting twice per week sounds more on the side of something is either broken or we're supercareful (e.g. my brand new Android phone, which also uses Linux kernel, needs a reboot maybe once per quarter).
user10489 avatar
in flag
This is what you get for installing a non-LTS version. The LTS version is much more stable and the updates are more slow paced, sometimes only once a month, and frequently don't require reboots. Make sure you upgrade in April 2022 and edit `/etc/update-manager/release-upgrades` and change it to `prompt=LTS` and I think you'll be much happier once it is fully stable.
ru flag
That's good advice, thanks!
Score:-1
it flag

Rebooting before an update is a useless piece of superstition. If you still find it necessary, suspect bad System Management.

Simply update your software version list (# apt update), then update your software (# apt upgrade).

If, after the update, any of the files /run/reboot* exists, a reboot is required, and the file contains a hint as to why.

Updating software thst is used as part of other software, or is used to start up the system is Hard. The other way would have to unboot the system, "rewind" the boot/startup process until nobody is using, or has used the new software, then un-unboot, resuming or restarting tasks. Deciding on how far to unboot, how to suspend/restart applications is Hard. Computer Science Hard.

We know of 1 way to restart everything so that it runs with current (as updated) software, why not use it? Besides, if rebooting does not work, we need to know Right Now.

As a consequence of rebooting, /run is recreated and the /run/reboot* files vanish.

ru flag
I didn't reboot before update. I simply finally rebooted when my system had been asking for it for days, the system started up, automatically downloaded fresh updates and asked for a reboot immediately after. I'm mentioning this to show how often I get reboot triggering updates, which I find weird. Also I really want the system to handle the updates automatically...
user10489 avatar
in flag
The default for `unattended-upgrades` is to only install security patches. I think you can change that. But you still can have pending updates when you reboot, so it's best to manually run the updates before rebooting anyway.
ru flag
As I said, being spoiled by how my phone works, I'm not really fond of manually managing updates :) But your point about LTS makes sense so I will try that out.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.