For example, awk
is a virtual package provided by original-awk
, mawk
and gawk
.
Trying to install it directly yields:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package awk is a virtual package provided by:
original-awk:i386 2012-12-20-4
mawk:i386 1.3.3-17ubuntu2
gawk:i386 1:4.1.1+dfsg-1
original-awk 2012-12-20-4
mawk 1.3.3-17ubuntu2
gawk 1:4.1.1+dfsg-1
You should explicitly select one to install.
E: Package 'awk' has no installation candidate
However many virtual packages are needed as dependencies by the packages installed by default, for example awk
itself is needed by base-files
, which checking the APT logs is installed along with a bunch of other packages through apt-get --yes
; somehow APT ends up picking one of the three automatically (I'm pretty sure that's mawk
, but that's not the point of the question).
How does APT choose the specific package to install in this case?
awk
. Check what package theawk
manpage came from - it may specify which one is actually installed.readlink -f $(which awk)
is a good hint (e.g. on my system/usr/bin/gawk
withgawk
installed and/usr/bin/mawk
withgawk
uninstalled). Problem is, this question actually arises from the fact that due to multiplegawk
reinstallations I can't check this that way no more, because the link (and theman
page for that matter) just points to the latest manually installed / the only one actually installed. So I was trying to grasp the "original" one the other way around, but at the end I ended up being more interested in knowing how the choice is made.gawk
andmawk
. They do not conflict.