Update notifier keeps popping up even when there is nothing to do
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
update-notifier (Ubuntu) |
Fix Released
|
Undecided
|
Renan Rodrigo | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
Update-notifier will trigger unnecessarily on systems where phased updates are considered in the Update Manager GUI but not considered in apt itself (for LTSs, Focal or earlier). If only the phased updates are available to a system, the dialog box will pop up, but it says that the system is up to date.
This happens because a recent SRU unintentionally broke the logic that treated this situations in the code. To avoid showing those packages, update-notifier needs access to the system apt Cache, but global side-effects of the apt + apt_pkg module interaction ended up providing the wrong Cache to verify phasing.
The fix for this is to isolate the esm Cache creation, restoring the default apt_pkg configuration after the instance is created, guaranteeing that any other Cache calls have access to the system data.
[ Test Plan ]
Besides testing the bugfix, it is important to test the functionality which changed this code in the first place, which was implemented to keep visibility to esm updates.
To reproduce the bug:
- Start a Focal machine
- Run `apt update`, verify which packages updates are phased (using apt show, for instance, will show a Phased-
- If there is no phased update happening, downgrade a package and fake phasing by editing the /var/lib/apt/lists file
- Install universe packages which have a esm-apps update (ansible is a good candidate)
- Run `/usr/lib/
- Run `/usr/lib/
To verify the fix:
- Install a version which contains this patch
- Run `/usr/lib/
- Run `/usr/lib/
[ Where problems could occur ]
If the function implemented for the fix has any flaw, then esm-apps updates will not show anymore, as they depend on the esm Cache. It is important to verify the esm-apps updates are exactly the same after the fix is applied, as described in the test plan above.
Any other call to any apt Cache functionality outside of this specific function should use the system defaults, which are restored by erasing the configuration and letting apt_pkg initialize it again, assuming safety.
The only known caveat is that the new function should be the only way to access the esm-cache; future instances should only be creating using the function, and never directly.
[ Original Description ]
Dialog "System is up to date" keeps popping up several times per session, even when there is no updates available and no reboot is required. Started a few weeks ago.
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: update-notifier 3.192.30.16
ProcVersionSign
Uname: Linux 5.15.0-60-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Thu Feb 23 10:09:59 2023
InstallationDate: Installed on 2020-10-24 (851 days ago)
InstallationMedia: Ubuntu 20.04 LTS "Focal Fossa" - Release amd64 (20200423)
ProcEnviron:
PATH=(custom, no user)
XDG_RUNTIME_
LANG=fr_FR.UTF-8
SHELL=/bin/bash
SourcePackage: update-notifier
UpgradeStatus: No upgrade log present (probably fresh install)
Related branches
- Athos Ribeiro (community): Approve
- git-ubuntu import: Pending requested
-
Diff: 71 lines (+32/-6)2 files modifieddata/apt_check.py (+26/-6)
debian/changelog (+6/-0)
- Athos Ribeiro: Approve
-
Diff: 71 lines (+32/-6)2 files modifieddata/apt_check.py (+26/-6)
debian/changelog (+6/-0)
- Athos Ribeiro: Approve
-
Diff: 71 lines (+32/-6)2 files modifieddata/apt_check.py (+26/-6)
debian/changelog (+6/-0)
- Athos Ribeiro: Approve
-
Diff: 71 lines (+32/-6)2 files modifieddata/apt_check.py (+26/-6)
debian/changelog (+6/-0)
- Athos Ribeiro: Approve
-
Diff: 71 lines (+32/-6)2 files modifieddata/apt_check.py (+26/-6)
debian/changelog (+6/-0)
tags: | added: regression-update |
Changed in update-notifier (Ubuntu): | |
assignee: | nobody → Renan Rodrigo (renanrodrigo) |
Changed in update-notifier (Ubuntu): | |
status: | Confirmed → In Progress |
description: | updated |
description: | updated |
description: | updated |
I can confirm this bug. I also use Ubuntu 20.04. I noticed, that it happens every time, when apt has an update, that isn't visible through the graphical frontend updater. If this is the case, the update notifier pops up with the message "System is up to date". If I than do "sudo apt update", apt shows me, that there is an update available. If I install this "invisible" update, the update notifier is calm again, e.g. the message "System is up to date" disappears.
This problem started after the introduction of Ubuntu Pro. It must have something to do with it.
Please, fix this bug.