Aptitude doesn’t remove automatically installed packages

aptitudedependencies

It seems aptitude doesn't remove automatically installed packages that are not depended on if these packages are suggested by any other (manually installed) ones.

root@host:/# aptitude install unattended-upgrades 
The following NEW packages will be installed:
  iso-codes{a} lsb-release{a} python-apt{a} python-apt-common{a} python2.6{a} python2.6-minimal{a} unattended-upgrades 
...

root@host:/# aptitude remove unattended-upgrades 
The following packages will be REMOVED:  
  unattended-upgrades 

...

root@host:/# aptitude why python-apt
i   apt Suggests python-apt

I can (somehow) understand why this is desirable, but is there any way to override it

Best Answer

This behavior is controlled by the option Apt::AutoRemove::SuggestsImportant.

Option: Apt::AutoRemove::SuggestsImportant

Default: true

Description: If this option is true, then aptitude will not consider packages to be unused (and thus will not automatically remove them) as long as any installed package suggests them. For more information, see the section called “Managing automatically installed packages”.

http://aptitude.alioth.debian.org/doc/en/ch02s05s05.html#configApt-AutoRemove-SuggestsImportant

You can set this option to false in one of aptitude's configuration files, to let aptitude automatically remove packages that are only suggested by other packages. E.g., edit or create /etc/apt/apt.conf and add the following line

Apt::AutoRemove::SuggestsImportant false;

Related Question