Automatic packages that are no longer used are marked as "id" in aptitude.
I find three ways to remove them.
Aptitude UI
sudo aptitudePress
gto preview packages to be installed and removed.You can find those packages under "Packages being removed because they are no longer used". Then press
gagain, aptitude will remove those packages.Aptitude command line with grep and xargs
aptitude search ~i | grep ^id | awk '{print $2}' | xargs sudo aptitude purge -yAptitude command line with
Aptitude::Delete-Unusedoptionsudo aptitude -o Aptitude::Delete-Unused=1 installOption: Aptitude::Delete-Unused
Default: true
Description: If this option is true, automatically installed packages which are no longer required will be automatically removed. For more information, see the section called “Managing automatically installed packages”.
I found this solution from http://www.lambdacurry.com/2013/12/aptitude-equivalent-of-apt-get-autoremove/. And the option is described in "Configuration file reference" in the aptitude reference manual. I don't have enough reputation to post more links, so you can search around for the document.
Either of them works for me.
