Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apt_info.py: fix apt_upgrades_pending and apt_upgrades_held #207

Merged
merged 4 commits into from
Apr 27, 2024

Conversation

kennethso168
Copy link
Contributor

Fixes #193

Fixed apt_upgrades_pending always empty, as after #181, cache.upgrade(True) is no longer called in script. This call marks the packages that could be upgraded, and without it, no package has the marked_upgrade boolean set to true. Changed to filter all packages that are installed and upgradable. This should match the output of apt list --upgradable

Also fixed apt_upgrades_held including all upgradable packages including packages that are not actually held. Package can be detected to be held according to https://askubuntu.com/a/965543.

Signed-off-by: kennethso168 <kennethso168@gmail.com>
Signed-off-by: kennethso168 <kennethso168@gmail.com>
Signed-off-by: kennethso168 <kennethso168@gmail.com>
@calvinbui
Copy link

i can confirm the apt_upgrades_pending is now working

@leahoswald
Copy link

leahoswald commented Apr 16, 2024

Could this be merged by anyone? Can confirm it's working too.

apt_info.py Outdated Show resolved Hide resolved
Signed-off-by: kennethso168 <kennethso168@gmail.com>
@calvinbui
Copy link

phased updates aren't working with apt_upgrades_held. the packages are listed as upgradable in apt_upgrades_pending, even though they are being kept back.

❯ sudo apt full-upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  cloud-init python3-update-manager update-manager-core
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

image

@dswarbrick dswarbrick merged commit 1cb6223 into prometheus-community:master Apr 27, 2024
4 checks passed
@dswarbrick
Copy link
Member

@calvinbui Please open a new issue to track the phased updates functionality. AFAIK, testing a package's state for SELSTATE_HOLD relates to packages that have been manually held, i.e. with apt-mark hold. If you know of a way to test whether a package is being held back due to being part of a phased update, please submit a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

apt_info.py - pending_upgrades always empty
4 participants