As izx said, in his general answer, the first point, can be the cause of this sort of things.
Those dependencies are now also required/recommended by some other package(s) which are still installed on your system.
This is the most probable and valid reason for this kind of situation,But I am thinking that, the other packages named with clamav clamav-base clamav-freshclam libclamav6 libtommath0
most likely only associated with their mother package clamav
. So, the first point, may not be the case in this particular situation.
The most likely cause of this problem, which seems to be the cause is, after installing the dansguardian
package, you later installed all it's dependency packages by doing this kind of command below:
sudo apt-get install clamav clamav-base clamav-freshclam dansguardian libclamav6 libtommath0
If this is indeed the case, you can't uninstalled them by removing their mother package dansguardian
. since in APT's language, they are installed "manually" as you explicitly installed these packages by feeding their name to the apt-get
command, so must also uninstall them with explicitly stating their package name
You can check this, if it is the case by viewing /var/log/apt/history.log
files.
To remove:
You must remove the installed packages by explicitly naming their name.So, in your specific situation it is
sudo apt-get purge clamav clamav-base clamav-freshclam dansguardian libclamav6 libtommath0
To see the dependent packages
You can find all the dependent packages with the below command:
apt-cache depends -i dansguardian | cut -f 2 -d ':' | tr '\n' ' '.
Note that, dansguardian
depends on package libc6
. while that package is very very essential one in your system. So, you can't remove all the dependency of dansguardian
by generating their dependency package list with apt-cache
command, hence it is not recommended. (actually, it is highly recommended to avoid doing that, unless you are happy with a broken system)
How does APT choose the specific package to install in this case?
APT doesn't select a package. It tells:
You should explicitly select one to install.
If you try to manually select a package, it wouldn't be installed.
In the case of base-files depending on awk it is irrelevant. First, it actually PreDepends on awk, forcing dpkg to install awk before starting to install base-files; second, mawk have priority required which are installed at system installation, and apt nags you if you try to remove it. So, just don't do it.
Now, according to sources, apt tries first of satisfying the dependency before trying with virtual packages (i.e., if depends are firefox | www-browser
, checks if any of the packages are installed, then try to install firefox if neither is). If the non-virtual package isn't available, it seems to just iterate over all packages which provides the virtual package, if no other dependencies are broken. Other comments evidence of this behavior are this which leads to GrpIterator::FindPreferredPkg function.
Best Answer
Use
apt-cache depends
to find a list of packages that the virtual package "contains" and then remove all of those in order to remove the virtual package. For example:Now all you have to do is
sudo apt-get remove
all of the packages listed afterDepends:
and once done, the virtual packagemono-complete
will be removed automagically.Run
sudo apt-cache depends
command first to take a look at all the dependent packages, and then, if the list of packages looks to you that it is ok to be removed, you can use this to remove them all:Once the job is done, you can check virtual package status with:
It should be marked as (n)ot installed.