Re: Virtual Package installation priority
Hi,
On Mon, Nov 11, 2019 at 09:31:03PM -0800, Ken Gilmer wrote:
> "To specify which of a set of real packages should be the default to
> satisfy a particular dependency on a virtual package, list the real package
> as an alternative before the virtual one."
> All I'm really looking for is an example...
Any package that depends on a mail transport agent, for example
$ apt show mailx
Package: bsd-mailx
[...]
Depends: [...], default-mta | mail-transport-agent, [...]
Here, default-mta is a metapackage that pulls in whatever MTA is currently
defined as default, and mail-transport-agent is a virtual package provided
by every MTA.
The effect of that is that if no MTA is installed and apt is asked to
install bsd-mailx, it will install the Debian default MTA instead of
semi-randomly choosing one (probably the one that comes first
alphabetically).
Note that for Build-Depends, it is an error to not provide a non-virtual
package as the first alternative, while for Depends, it is allowed for
historical reasons.
Simon
Reply to: