I'd like to create an open-ended list of packages, of which only one may be installed at any time.
Think of it as some kind of system service that listens on port 1234 (I made that up, for this example). There might be three implementations from me, all of which support the 1234-port protocol, and the user may install one of them at a time, but no more than one. But then there might also be implementations from other people who I don't know about it. I'd like pacman to say something like:
> pacman -S third-party-1234-package
Sorry, you already have installed the wonderful-1234-package, which you will need to uninstall before you can install this one.
How would I get makepkg/pacman to do that? (Yes, I understand that in this scenario, I could install but not run several implementations. But my question is about how I prevent the installation of another packages in the same category, not how to prevent that more than one runs.)
This sounds like a really strange situation... It might help us help you if you tell us the problem you are working on instead of what you think is the solution.
mesa-libgl, nvidia-libgl and nvidia-304xx-utils provide libgl:
$ pacman -Qqs libgl mesa mesa-libgl $ sudo pacman -S nvidia-libgl resolving dependencies... looking for inter-conflicts... :: nvidia-libgl and mesa-libgl are in conflict (libgl). Remove mesa-libgl? [y/N]
@karol: great example! Poking around the PKGBUILD files, it seems that both say:
and that produces the behavior. So if I said in all of my packages
(but didn't provide a package called 'any-1234-package' directly), I should get the desired behavior?
jernst, that is the idea.
'any-1234-package' would be what's called a 'virtual package' .
Some other examples of existing 'virtual packages' : java-runtime , java-environment , cron, libgl
Booting with apg Openrc, NOT systemd.
Automounting : not needed, i prefer pmount
Aur helpers : makepkg + my own local repo === rarely need them