Public bug reported: >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) ** Affects: aptitude (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug bionic third-party-packages -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1772688 Title: Aptitude does not want to autoremove Linux kernel, while apt wants To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/aptitude/+bug/1772688/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs