Skip to main content
1 of 2
lbs
  • 59
  • 3

Automatic packages that are no longer used are marked as "id" in aptitude.

I find three ways to remove them.

  1. Aptitude UI

    sudo aptitude

    Press g to preview packages to be installed and removed.

    enter image description here

    You can find those packages under "Packages being removed because they are no longer used". Then press g again, aptitude will remove those packages.

  2. Aptitude command line with grep and xargs

    aptitude search ~i | grep ^id | awk '{print $2}' | xargs sudo aptitude purge -y

  3. Aptitude command line with Aptitude::Delete-Unused option

    sudo aptitude -o Aptitude::Delete-Unused=1 install

    Option: 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.

lbs
  • 59
  • 3