Aptitude does not want to autoremove Linux kernel, while apt wants

Bug #1772688 reported by Dmitry Lapshin
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
aptitude (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

From some update last year or so, apt has achived the tools to remove old Linux kernels via /etc/kernel/postinst.d/apt-auto-removal. This is really great, but for some reason, all apt tools agree on this (apt-get autoremove, apt autoremove), but aptitude does not.

For example, here I have an installation where 4.15.0-20 is safe for deinstallation, and generated by script above config agrees:

  $ LANG=C apt --dry-run autoremove
  NOTE: This is only a simulation!
        apt needs root privileges for real execution.
        Keep also in mind that locking is deactivated,
        so don't depend on the relevance to the real current situation!
  Reading package lists... Done
  Building dependency tree
  Reading state information... Done
  The following packages will be REMOVED:
    linux-cloud-tools-4.15.0-20 linux-cloud-tools-4.15.0-20-generic linux-headers-4.15.0-20
    linux-headers-4.15.0-20-generic linux-image-4.15.0-20-generic linux-modules-4.15.0-20-generic
    linux-modules-extra-4.15.0-20-generic linux-tools-4.15.0-20 linux-tools-4.15.0-20-generic
  0 upgraded, 0 newly installed, 9 to remove and 0 not upgraded.
  Remv linux-cloud-tools-4.15.0-20-generic [4.15.0-20.21]
  Remv linux-cloud-tools-4.15.0-20 [4.15.0-20.21]
  Remv linux-headers-4.15.0-20-generic [4.15.0-20.21] <--- Those
  Remv linux-headers-4.15.0-20 [4.15.0-20.21] <--- little
  Remv linux-modules-extra-4.15.0-20-generic [4.15.0-20.21]
  Remv linux-image-4.15.0-20-generic [4.15.0-20.21] <--- buggers
  Remv linux-modules-4.15.0-20-generic [4.15.0-20.21] <--- here!
  Remv linux-tools-4.15.0-20-generic [4.15.0-20.21]
  Remv linux-tools-4.15.0-20 [4.15.0-20.21]

but aptitude does not:

  $ LANG=C aptitude --simulate safe-upgrade
  The following packages will be REMOVED:
    linux-cloud-tools-4.15.0-20{u} linux-cloud-tools-4.15.0-20-generic{u}
    linux-modules-extra-4.15.0-20-generic{u} linux-tools-4.15.0-20{u}
    linux-tools-4.15.0-20-generic{u}
  0 packages upgraded, 0 newly installed, 5 to remove and 0 not upgraded.
  Need to get 0 B of archives. After unpacking 178 MB will be freed.

  Note: Using 'Simulate' mode.
  Do you want to continue? [Y/n/?] y
  Would download/install/remove packages.

Removing modules-extra seems fine for it, though!
I have looked over all apt configs, there was no sign for me that aptitude was configured specificly to keep the images.

ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: aptitude 0.8.10-6ubuntu1
ProcVersionSignature: Ubuntu 4.15.0-21.22-generic 4.15.17
Uname: Linux 4.15.0-21-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.20.9-0ubuntu7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Tue May 22 19:48:48 2018
InstallationDate: Installed on 2017-03-05 (443 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.1)
ProcEnviron:
 TERM=tmux-256color
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=ru_RU.UTF-8
 SHELL=/bin/bash
SourcePackage: aptitude
UpgradeStatus: Upgraded to bionic on 2018-05-03 (18 days ago)

Revision history for this message
Dmitry Lapshin (lapshin-dv) wrote :
Revision history for this message
Dmitry Lapshin (lapshin-dv) wrote :

Forgot one thing: if ask aptitude explicitly why linux-image-... is needed, it will reply that no reason for this package was found.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in aptitude (Ubuntu):
status: New → Confirmed
Revision history for this message
Hans W (lucem) wrote :

Exactly the same here

Revision history for this message
Hans W (lucem) wrote :

Might be related to /etc/apt/apt.conf.d/01autoremove{,-kernels}?

Revision history for this message
Dmitry Lapshin (lapshin-dv) wrote :

It's actually the files that configure apt to do intended behavior, but somehow aptitude has it's own mind :/

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.