You are not logged in.
Sorry if this is a silly question, but I cannot find it in the man page:
If package "bash" says it "provides" package "sh", then installing package "mono" (which depends on "sh") will resolve that dependency against "bash".
But how do I do an equivalent query using pacman, such as "show me all packages that "provide" "sh""?
Last edited by jernst (2018-03-19 17:20:03)
Offline
pacman -S sh
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
Right. But if there are several packages that "provide" the same (virtual) package, how can I determine what my choices are without starting to install one?
Offline
If you know the expected file then you can use -Fo option, which will list all packages containing that file.
pacman -Fo usr/bin/sh
But the following should give you what you want exactly
For example to look for packages which provide "cron" package:
pacman -Si | grep "^\(Name\|Provides\)\s" | grep -EB1 "^Provides\s+:.+\bcron\b"
Name : cronie
Provides : cron
--
Name : fcron
Provides : cron
--
Name : dcron
Provides : cron
Offline
pacsift --sync --provides=sh
Requires the pacutils package from community.
Note that there is only one package which provides /bin/sh so this wasn't a great example.
If you know the expected file then you can use -Fo option, which will list all packages containing that file.
pacman -Fo usr/bin/sh
But the following should give you what you want exactly
For example to look for packages which provide "cron" package:
pacman -Si | grep "^\(Name\|Provides\)\s" | grep -EB1 "^Provides\s+:.+\bcron\b" Name : cronie Provides : cron -- Name : fcron Provides : cron -- Name : dcron Provides : cron
All this grep is super inefficient.
Also:
$ pacsift --sync --provides=cron
core/cronie
community/fcron
$ pacman -Si dcron
error: package 'dcron' was not found
Something you're not mentioning? Like, for example, the "Repository" key?
Last edited by eschwartz (2018-03-19 04:58:38)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
grep isn't inefficient but listing ALL package details is inefficient.
Otherwise first grep will eliminate most lines instantly.
But then it does the work if its only one time thing. (Yes pacsift is better solution but this works if you dont want to install additional package)
Actually I have archlinuxcn repo enabled (for gnucash) which also has dcron. (Hence it got listed in my example)
I just gave a template example on how it can be done. If user does not have particular repository its not going to be listed anyway. So no need to give Repository key unless he wants to check a specific repository. (OP didnt mention anything about knowing repository)
Last edited by amish (2018-03-19 05:21:57)
Offline
Right. But if there are several packages that "provide" the same (virtual) package, how can I determine what my choices are without starting to install one?
Again: `pacman -S <pkg>` That's it.
For example:
# pacman -S cron
:: There are 2 providers available for cron:
:: Repository core
1) cronie
:: Repository community
2) fcron
Enter a number (default=1):
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
Of course, -S doesn't work when it's also the name of a package, which is an extremely common case.
Offline
But that does precisely meet the criteria set out in the first post. If a package (e.g. 'mono') listed a dependency for which there was an exact package name match and other packages that 'provide' the same thing, then the exact match would be installed as a dependency with no option provided.
So given the question "how do I do the equivalent query" the answer is `pacman -S <pkgname>`.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Online
pacsift --sync --any --exact --provides=foo --name=foo
This will match an exact pkgname, and tell you all packages that either are that pkgname or provide it.
I think this should make everyone happy, right?
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
I didn't know about pacsift. That seems to be the most comfortable answer. Thanks, everybody.
Offline