How do I find which rpm package supplies a file I'm looking for?
Even when this is an old question, I believe it worths to have a handy reminder.
As an example, let's suppose that I am installing PHP manually and the following error arises:
What do we do next?
You can use yum whatprovides command, with the absolute path to the file you want (which may be wildcarded). For example:
And the expected output would be:
Now, you can list the required package as follows:
And then, install it executing:
Super simple!
As an example, let's suppose that I am installing PHP manually and the following error arises:
configure: error: webp/decode.h not found.
What do we do next?
You can use yum whatprovides command, with the absolute path to the file you want (which may be wildcarded). For example:
yum whatprovides '*webp/decode.h'
And the expected output would be:
Loaded plugins: priorities, update-motd, upgrade-helper
libwebp-devel-0.3.0-3.5.amzn1.x86_64 : Development files for libwebp, a library for the WebP format
Repo : amzn-main
Matched from:
Filename : /usr/include/webp/decode.h
From the above output, we can obtain that the RPM file we are looking for is "libwebp-devel-0.3.0-3.5.amzn1.x86_64" package.Now, you can list the required package as follows:
yum list libwebp-devel
And then, install it executing:
yum install libwebp-devel
Super simple!
No comments