Why is apt-get --auto-remove not removing all dependencies?

Posted by Mike on Ask Ubuntu See other posts from Ask Ubuntu or by Mike
Published on 2012-06-24T02:37:40Z Indexed on 2012/06/24 3:24 UTC
Read the original article Hit count: 307

Filed under:
|
|

I just installed a package (dansguardian in this case) and apt told me that I had unmet dependencies.

# sudo apt-get install dansguardian
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  clamav clamav-base clamav-freshclam libclamav6 libtommath0
Suggested packages:
  clamav-docs squid libclamunrar6
The following NEW packages will be installed:
  clamav clamav-base clamav-freshclam dansguardian libclamav6 libtommath0
0 upgraded, 6 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/4,956 kB of archives.
After this operation, 14.4 MB of additional disk space will be used.
Do you want to continue [Y/n]?

So I installed it and the dependencies. So far so good.

Later on, I decide that this package just isn't the package for me, so I want to remove it and all of the other junk it installed with it since I'm not going to be needing any of it:

# sudo apt-get remove --auto-remove --purge dansguardian
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  dansguardian
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
After this operation, 1,816 kB disk space will be freed.
Do you want to continue [Y/n]?

However it is only removing that one specific package. What about clamav clamav-base clamav-freshclam libclamav6 libtommath0? Not only did it not remove them, but clamav was actually running a daemon that loads every time the computer boots. I thought that --auto-remove would remove not only the packages, but also the dependencies that were installed with it.

So basically, without going through the apt history log file (if I even remember to do so, or if I even remember that a specific package I installed 3 months ago had dependencies along with it), is there a way to remove a package and all of the other dependencies that were installed like in this case?

© Ask Ubuntu or respective owner

Related posts about apt

Related posts about package-management