Is it possible to perform an equivalent of apt-get autoremove with aptitude? If yes, how?
The Debian Administrator's Handbook says that aptitude "autoremoves" packages automatically, but this is not true (not always true). In my case (Ubuntu GNOME 16.04), I have a linux kernel which apt-get autoremove suggests to get me rid of:
§ sudo apt-get autoremove
[sudo] password for alexey:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic
linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
After this operation, 295 MB disk space will be freed.
Do you want to continue? [Y/n]
aptitude, however, does not care about it.
Here is the output of aptitude why linux-image-4.4.0-31-generic:
i ubuntu-gnome-desktop Depends gdm3
i A gdm3 Recommends xserver-xorg
c xserver-xorg Recommends xserver-xorg-video-all | xorg-driver-video
p virtualbox-guest-x11 Provides xorg-driver-video
p virtualbox-guest-x11 Depends virtualbox-guest-utils (= 5.0.32-dfsg-0ubuntu1.16.04.2)
p virtualbox-guest-utils Recommends virtualbox-guest-dkms (= 5.0.32-dfsg-0ubuntu1.16.04.2) | v
irtualbox-guest-source (= 5.0.32-dfsg-0ubuntu1.16.04.2) |
virtualbox-guest-modules
i A linux-image-4.4.0-31-generic Provides virtualbox-guest-modules
Here is the output of aptitude search '~i linux.*4.4.0-31' -F '%c%a%M %p':
i A linux-headers-4.4.0-31
i A linux-headers-4.4.0-31-generic
i A linux-image-4.4.0-31-generic
i A linux-image-extra-4.4.0-31-generic

aptitude why linux-image-4.4.0-31-genericoutput?aptitude why linux-image-4.4.0-31-generic.apt-get autoremovealso says it can remove linux-headers-6.8.0-55, linux-headers-6.8.0-55-generic, linux-image-6.8.0-55-generic, linux-modules-6.8.0-55-generic, and linux-modules-extra-6.8.0-55-generic. I don't get it. Oh well.