How to use /etc/alternatives effectively?
/etc/alternatives is intended to provide a facility to conveniently install and use multiple versions of a single software package (e.g. a compiler). Now /usr/bin/some-binary can be a symlink to /etc/alternatives/some-binary and update-alternatives However, a distribution's package manager might assume it has control over /usr/bin/some-binary. Is the best solution to have /etc/alternatives early in the PATH environment variable? Are there alternatives (sic) for managing this tension in a way that means it is easy to choose the version you want without breaking the ability to use the versions available package manager?
1 Answer
Any distribution that implements alternatives and also provides a package manager, should provide a package manager that respects alternatives, otherwise it would be considered broken.
So putting /etc/alternatives into the path might fix the actions package manager that is broken in this sense. It is difficult to see if this would have unintended consequences in this type of environment.
If this situation arises, my approach would be to manually repair the problem caused by the package manager, where it places an actual binary instead of a symlink, and then file a bug asking for it to be fixed.