You are not logged in.
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.)
Offline
Take a look at the PKGBUILD provides and conflicts fields.
Last edited by Slithery (2014-03-05 10:00:42)
Offline
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.
Offline
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]
Offline
@karol: great example! Poking around the PKGBUILD files, it seems that both say:
conflicts=('libgl')
provides=('libgl')
and that produces the behavior. So if I said in all of my packages
conflicts=('any-1234-package')
provides=('any-1234-package')
(but didn't provide a package called 'any-1234-package' directly), I should get the desired behavior?
Offline
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
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
(A works at time B) && (time C > time B ) ≠ (A works at time C)
Offline
Thanks, everybody, this was very quick, the the point, and just what I needed to know. #greatcommunity
Offline