[Aptitude-devel] Bug#1082745: aptitude: information mismatch for package removal
Vincent Lefevre
vincent at vinc17.net
Wed Oct 2 11:48:29 BST 2024
This issue occurred again for the new Linux kernel upgrade.
Here's additional information.
The reformatted diff on the /var/lib/aptitude/pkgstates file
just after the upgrade:
----------------------------------------
Package: linux-headers-6.10.12-amd64
Architecture: amd64
Unseen: yes
State: 1
-Dselect-State: 0
+Dselect-State: 1
Remove-Reason: 0
-Auto-New-Install: yes
Package: linux-doc-6.10
Architecture: amd64
Unseen: yes
State: 1
Dselect-State: 1
Remove-Reason: 0
-Upgrade: yes
Package: linux-headers-6.10.12-common
Architecture: amd64
Unseen: yes
State: 1
-Dselect-State: 0
+Dselect-State: 1
Remove-Reason: 0
-Auto-New-Install: yes
Package: linux-headers-6.10.9-common
Architecture: amd64
Unseen: yes
-State: 1
+State: 3
Dselect-State: 1
-Remove-Reason: 0
+Remove-Reason: 4
Architecture: amd64
Unseen: no
State: 1
Dselect-State: 1
Remove-Reason: 0
-Upgrade: yes
Package: linux-image-amd64
Architecture: amd64
Unseen: no
State: 1
Dselect-State: 1
Remove-Reason: 0
-Upgrade: yes
Package: linux-doc
Architecture: amd64
Unseen: no
State: 1
Dselect-State: 1
Remove-Reason: 0
-Upgrade: yes
Package: linux-headers-6.10.9-amd64
Architecture: amd64
Unseen: yes
-State: 1
+State: 3
Dselect-State: 1
-Remove-Reason: 0
+Remove-Reason: 4
Package: linux-kbuild-6.10.9
Architecture: amd64
Unseen: yes
-State: 1
+State: 3
Dselect-State: 1
-Remove-Reason: 0
+Remove-Reason: 4
Package: linux-image-6.10.12-amd64
Architecture: amd64
Unseen: yes
State: 1
-Dselect-State: 0
+Dselect-State: 1
Remove-Reason: 0
-Auto-New-Install: yes
Package: linux-libc-dev
Architecture: amd64
Unseen: no
State: 1
Dselect-State: 1
Remove-Reason: 0
-Upgrade: yes
----------------------------------------
and "apt install -f -s" outputs
The following packages were automatically installed and are no longer required:
linux-headers-6.10.9-amd64 linux-headers-6.10.9-common linux-image-6.10.9-amd64 linux-kbuild-6.10.9
Use 'apt autoremove' to remove them.
but note that aptitude does not say anything about the old kernel
image linux-image-6.10.9-amd64 in the /var/lib/aptitude/pkgstates
diff above. It still has:
Package: linux-image-6.10.9-amd64
Architecture: amd64
Unseen: yes
State: 1
Dselect-State: 1
Remove-Reason: 0
In its TUI, aptitude initially says, just after the upgrade:
Packages Preview
aptitude 0.8.13 @ cventin Disk: -67.6 MB
--\ Packages being removed because they are no longer used (3)
idA linux-headers-6. -4012 kB 6.10.9-1 6.10.9-1
idA linux-headers-6. -61.4 MB 6.10.9-1 6.10.9-1
idA linux-kbuild-6.1 -2271 kB 6.10.9-1 6.10.9-1
and no other packages are marked as to be removed (not even
linux-image-6.10.9-amd64).
Just after hitting '_' over "Packages being removed because they
are no longer used", I get
Packages Preview
aptitude 0.8.13 @ cventin Disk: -172 MB
--\ Packages being removed because they are no longer used (3)
ipA linux-headers-6. -4012 kB 6.10.9-1 6.10.9-1
ipA linux-headers-6. -61.4 MB 6.10.9-1 6.10.9-1
ipA linux-kbuild-6.1 -2271 kB 6.10.9-1 6.10.9-1
In particular, the "Disk:" value has changed. And still no other
packages are marked as to be removed, which is contradictory
with the change of the "Disk:" value.
After hitting 'qg', I get:
Packages Preview
aptitude 0.8.13 @ cventin Disk: -172 MB
--\ Packages being removed because they are no longer used (4)
ipA linux-headers-6. -4012 kB 6.10.9-1 6.10.9-1
ipA linux-headers-6. -61.4 MB 6.10.9-1 6.10.9-1
idA linux-image-6.10 -104 MB 6.10.9-1 6.10.9-1
ipA linux-kbuild-6.1 -2271 kB 6.10.9-1 6.10.9-1
Now linux-image-6.10.9-amd64 is marked as to be removed
(and has 'd' instead of 'p').
It seems that contrary to apt, aptitude detects too late that
linux-image-6.10.9-amd64 should be removed, with 2 consequences
when hitting '_' to purge instead of just remove:
* aptitude adds linux-image-6.10.9-amd64 to the package to be
removed, but the user is not notified, so this is big surprise
if the user does not do 'qg' first, and possibly incorrect and
too late if the user does not want to remove this kernel image
(e.g. because the newer images are broken).
* linux-image-6.10.9-amd64 will just be removed, but not purged.
--
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
More information about the Aptitude-devel
mailing list