I'd like to query the pacman database for the package that satisfies a requirement: essentially the package that would get installed if I were to run pacman -S <requirement>.
It appears there are three cases:
- The requirement is the name of a package.
- The requirement is the name of a file or library.
- The requirement appears in the
providesfield of another package.
The first two cases are pretty straightforward, but the third one is causing me trouble.
For example, the requirement apache-ant is provided by package ant.
pacman -S apache-ant correctly identifies and installs ant.
pacman -Q apache-ant returns the information I want, but only if the package is already installed.
Is there a command that works similarly to pacman -Q, but does not fail if the package isn't locally installed?