2017-06-16 23:07:11 UTC
ânix-env --set-flag priority NUMBER PKGNAMEâ to change the priority of
one of the conflicting packages
I understand what causes it (two packages competing to place the same,
e.g., binaries in my profile), but Iâve never understood how to resolve it.
Usually I just guess priority numbers until it works; more lately Iâve
simply removed the offending package from my environment before repeating
the failing install command. Obviously, neither approach is healthy or
The man page for nix-env contains the following:
If there are multiple derivations matching a name in args that have the
same name (e.g., gcc-3.3.6 and gcc-4.1.1), then the derivation with the
highest priority is used. A derivation can define a priority by declaring
the meta.priority attribute. This attribute should be a number, with a
higher value denoting a lower priority. The default priority is 0.
But Iâm still not sure what this means for my error situation. How do I
know what the priorities are for the different packages? The default value
is 0, which is the highest priority; what does that mean exactly, for the
default priority to be the highest priority?
Is there a more intuitive way to resolve this sort of conflict? For
instance, is there a way to tell nix-env to force the issue by treating the
requested package as higher priority than any existing ones?