[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: When to reboot after dist-upgrade?



I use the following little script.  If it produces output, then a reboot is desirable.

#!/bin/bash -p

set -x

PATH=/usr/bin:/bin

lsof +c0 -w | grep ' DEL  *REG  *[^0 ]' | egrep -v \ '(/var/lib/gdm3|/usr/share/mime|/home/[^/]*)/(.cache|.config|.local)'


What it does is look for library (and other) files that are in use but have been removed from the filesystem.  The "egrep -v" filters out some files that various utilities create, open, then delete without closing so that if the utility ends catastrophically without cleaning up, they don't hang around.  It's not perfect, but it does help.

Rick

On Sun, May 2, 2021, at 9:16 PM, Kenneth Parker wrote:


On Sun, May 2, 2021, 9:42 PM riveravaldez <riveravaldezmail@gmail.com> wrote:
Hi, sorry if this is not the place to ask (and in that case please
point me in the proper direction).

I'm trying to distinguish when a system reboot is an absolute need
and when it is absolutely safe to keep the system running/working
after a `sudo apt-get update && sudo apt-get dist-upgrade`, once
I have already performed a complete restart of all needed services
through `sudo needrestart' options in Debian testing.

In general, if the Kernel is updated, plan to Restart.  Usually, dist-upgrade is required, when Version Numbers change, requiring addition of new packages.  The Linux Kernel is a common (but not the only) reason for this. 

Also beware, because Debian occasionally will update the Kernel without updating the Version Number.  So it is possible that a Restart is required, without a dist-upgrade. 

Good luck! 

Kenneth Parker 


So, in a situation like this:

$ sudo apt-get dist-upgrade
Reading package list ... Done
Creating dependency tree ... Done
Reading status information ... Done
Calculating the update ... Done
The following packages have been withheld:
   imagemagick inkscape libc-bin libc6 libc6-dbg libcrypt1
libpoppler-glib8 local openssh-client openssh-server
openssh-sftp-server ssh
0 updated, 0 new will be installed, 0 to remove, and 12 not updated.

$ sudo needrestart
Scanning processes...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

Failed to check for processor microcode upgrades.

No services need to be restarted.

No containers need to be restarted.

No user sessions are running outdated binaries.

$ sudo checkrestart
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs
      Output information may be incomplete.
Found 6 processes using old versions of upgraded files
(1 distinct program)
(0 distinct packages)
No packages seem to need to be restarted.
(please read checkrestart(8))

, would be perfectly safe and right to keep the system running or on
the contrary should I perform a (warm/cold?) reboot to be safe?

Thanks a lot in advance for any hint or info.

Kind regards.

PS: `apt-get dist-upgrade` output is translated to English..., system is
in Spanish and I keep not-remembering how to force console output
to English, sorry...



Reply to: