Search yum for the content of a package

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, November 28, 2014

Follow me on Twitter as @mattiasgeniar

Yum can do more things than just a yum search $package. It also allows you to search for a package that contains a certain file. For that, you can use the yum whatprovides command.

For instance, if you want to search for what package contains the /usr/bin/node binary (for NodeJS), you can search like this.

$ yum whatprovides */usr/bin/node
...
nodejs-0.10.32-1.el6.i686 : JavaScript runtime
Repo        : epel
Matched from:
Filename    : /usr/bin/node


nodejs-0.10.32-1.el6.x86_64 : JavaScript runtime
Repo        : epel
Matched from:
Filename    : /usr/bin/node

The syntax is yum whatprovides */path/to/your/file or a wildcard, like yum whatprovides */file. To search the node binary, you can also make it shorter:

$ yum whatprovides */node
...

And there’s a few more little tricks that yum provides as well.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.