[Bug 1842159] Re: Please suggest running apt update & apt upgrade in MOTD when list of available packages is old

Balint Reczey balint.reczey at canonical.com
Mon Dec 16 14:14:12 UTC 2019


root at ee-motd-verify:~# update-motd 
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Dec 16 14:12:40 UTC 2019

  System load:    0.95      Processes:           28
  Usage of /home: unknown   Users logged in:     0
  Memory usage:   0%        IP address for eth0: 10.84.73.58
  Swap usage:     38%

28 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable


root at ee-motd-verify:~# touch -t 01010101 /var/lib/update-notifier/updates-available
root at ee-motd-verify:~# update-motd
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Dec 16 14:13:01 UTC 2019

  System load:    0.9       Processes:           28
  Usage of /home: unknown   Users logged in:     0
  Memory usage:   0%        IP address for eth0: 10.84.73.58
  Swap usage:     38%


28 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable


The list of available updates is more than a week old.
To check for new updates run: sudo apt update

root at ee-motd-verify:~# rm /var/lib/update-notifier/updates-available
root at ee-motd-verify:~# update-motd 
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Dec 16 14:13:15 UTC 2019

  System load:    1.0       Processes:           28
  Usage of /home: unknown   Users logged in:     0
  Memory usage:   0%        IP address for eth0: 10.84.73.58
  Swap usage:     38%


The list of available updates is more than a week old.
To check for new updates run: sudo apt update

root at ee-motd-verify:~# apt update -qq
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
root at ee-motd-verify:~# update-motd 
Welcome to Ubuntu 19.10 (GNU/Linux 5.0.0-37-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/advantage

  System information as of Mon Dec 16 14:13:28 UTC 2019

  System load:    0.78      Processes:           28
  Usage of /home: unknown   Users logged in:     0
  Memory usage:   0%        IP address for eth0: 10.84.73.58
  Swap usage:     38%


28 updates can be installed immediately.
0 of these updates are security updates.
To see these additional updates run: apt list --upgradable


root at ee-motd-verify:~# dpkg -l update-notifier-common | cat
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                   Version      Architecture Description
+++-======================-============-============-=======================================================
ii  update-notifier-common 3.192.26.1   all          Files shared between update-notifier and other packages


** Tags removed: verification-needed verification-needed-eoan
** Tags added: verification-done verification-done-eoan

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to update-notifier in Ubuntu.
https://bugs.launchpad.net/bugs/1842159

Title:
  Please suggest running apt update & apt upgrade in MOTD  when list of
  available packages is old

Status in update-notifier package in Ubuntu:
  Fix Released
Status in update-notifier source package in Xenial:
  New
Status in update-notifier source package in Bionic:
  New
Status in update-notifier source package in Disco:
  New
Status in update-notifier source package in Eoan:
  Fix Committed

Bug description:
  [Impact]

   * Users don't have up to date information about available updates when network connectivity or other issues prevented automated apt updates.
   * It is desired to give the user accurate and up to date information about available updates or warn them if the information is outdated.
   * The fix notifies user about stale updates information in MOTD

  [Test Case]

   * Install update-motd and the the fixed package.
   * Observe the output of sudo update-motd printing the usual output
   * "Date back" the updates information:
     $ sudo touch -t 01010101 /var/lib/update-notifier/updates-available
   * Observe the output of sudo update-motd printing warning about outdated update information.
   * Remove the updates information:
     $ sudo rm /var/lib/update-notifier/updates-available
   * Observe the output of sudo update-motd printing warning about outdated update information.

  [Regression Potential]

   * An error may be printed in MOTD or the warning message may appear
  needlessly in case of making a mistake in implementing the fix.

  [Original Bug Text]

  When logging into a system where the package list is not updated for
  long time (for example because is offline) I may see:

  ...
  0 updates can be installed immediately.
  0 of these updates are security updates.
  ..

  Which is true, but the user may think that there are no available
  updates released.

  Also, if the /var/lib/update-notifier/updates-available is missing
  (which can happen due to network connectivity issues of due to bugs)
  there is no mention of updates in MOTD.

  If the  /var/lib/update-notifier/updates-available is older than a few
  days (weeks?) or it is missing and the packages list is older than a
  few days (weeks?) please recommend running apt update & upgrade in the
  MOTD snippet:

  ...
  The list of available updates is not refreshed in N days.
  Please run "sudo apt update" and then "sudo apt upgrade" to
  keep your system up to date.
  ...

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/update-notifier/+bug/1842159/+subscriptions



More information about the foundations-bugs mailing list