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

Bug #1842159 reported by Balint Reczey
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
update-notifier (Ubuntu)
Undecided
Unassigned
Xenial
Undecided
Unassigned
Bionic
Undecided
Unassigned
Disco
Undecided
Unassigned
Eoan
Undecided
Unassigned

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.
...

Related branches

Balint Reczey (rbalint)
summary: - Please suggest running apt update & apt upgrade in MOTD, list of
+ Please suggest running apt update & apt upgrade in MOTD when list of
available packages is old
tags: added: id-5ca609ba6cd52782e994a6e1
Revision history for this message
Kenneth Kolano (kolano) wrote :

It seems the update counts generally may not be populated correctly on initial login.

Under 19.04 I'm currently seeing these counts on initial login...

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

...but then immediately after login...

sudo cat /var/lib/update-notifier/updates-available

66 updates can be installed immediately.
8 of these updates are security updates.

Balint Reczey (rbalint)
description: updated
tags: added: id-5d78fc6cca6d1b77a77952cc
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.27

---------------
update-notifier (3.192.27) focal; urgency=medium

  * Notify user about stale updates information in motd (LP: #1842159)
  * Make /var/lib/update-notifier/updates-available world-readable
    (LP: #1844704)
  * data/update-motd-hwe-eol: Run as a regular user without printing errors
    (LP: #185527)
  * data/update-motd-hwe-eol: Shortcut script when running in a container.
    There is no point in checking the HWE stack in a container since upgrading
    it would not affect the host system. (LP: #1855290)
  * data/update-motd-fsck-at-reboot: Shortcut script when running it as
    a regular user (LP: #185527)

 -- Balint Reczey <email address hidden> Thu, 05 Dec 2019 15:02:52 +0100

Changed in update-notifier (Ubuntu):
status: New → Fix Released
Balint Reczey (rbalint)
tags: added: wsl
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Please test proposed package

Hello Balint, or anyone else affected,

Accepted update-notifier into eoan-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/update-notifier/3.192.26.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-eoan to verification-done-eoan. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-eoan. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in update-notifier (Ubuntu Eoan):
status: New → Fix Committed
tags: added: verification-needed verification-needed-eoan
Revision history for this message
Balint Reczey (rbalint) wrote :
Download full text (3.3 KiB)

root@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@ee-motd-verify:~# touch -t 01010101 /var/lib/update-notifier/updates-available
root@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@ee-motd-verify:~# rm /var/lib/update-notifier/updates-available
root@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@ee-motd-verify:~# apt update -qq
28 packages can be upgraded. Run 'apt list --upgradable' to see them.
root@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@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
+++-======================-============-============-==========...

Read more...

tags: added: verification-done verification-done-eoan
removed: verification-needed verification-needed-eoan
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 3.192.26.1

---------------
update-notifier (3.192.26.1) eoan; urgency=medium

  * Notify user about stale updates information in motd (LP: #1842159)
  * Make /var/lib/update-notifier/updates-available world-readable
    (LP: #1844704)
  * data/update-motd-hwe-eol: Run as a regular user without printing errors
    (LP: #1855271)
  * data/update-motd-hwe-eol: Shortcut script when running in a container.
    There is no point in checking the HWE stack in a container since upgrading
    it would not affect the host system. (LP: #1855290)
  * data/update-motd-fsck-at-reboot: Shortcut script when running it as
    a regular user (LP: #1855271)

 -- Balint Reczey <email address hidden> Thu, 05 Dec 2019 15:02:52 +0100

Changed in update-notifier (Ubuntu Eoan):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for update-notifier has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Steve Langasek (vorlon)
Changed in update-notifier (Ubuntu Disco):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers