Finding what installed a binary with YUM and RPM

Written by Benjamin Cane on 2011-08-03 07:05:00

Ever find yourself wondering what package installed a binary on your Red Hat or Red Hat like distro's? Well you can find that out pretty easily using yum or rpm.

[[email protected] ~]# yum whatprovides /usr/bin/ssh
Loaded plugins: langpacks, presto, refresh-packagekit  
Adding en_US to language list  
openssh-clients-5.5p1-21.fc14.2.i686 : An open source SSH client applications  
Repo : fedora  
Matched from:  
Filename : /usr/bin/ssh  

openssh-clients-5.5p1-24.fc14.2.i686 : An open source SSH client applications  
Repo : updates  
Matched from:  
Filename : /usr/bin/ssh  

openssh-clients-5.5p1-24.fc14.2.i686 : An open source SSH client applications  
Repo : installed  
Matched from:  
Other : Provides-match: /usr/bin/ssh

You can also use rpm to find the same information.

[[email protected] ~]# rpm -q --whatprovides /usr/bin/ssh
openssh-clients-5.5p1-24.fc14.2.i686

One of the major differences between the two is Yum will check its repositories to find any package that can offer this binary. Where as rpm will check the rpmdb to tell you which exact package installed that binary.


Picture of Benjamin Cane

Benjamin is a Systems Architect working in the financial services industry focused on platforms that require Continuous Availability. He has been working with Linux and Unix for over 10 years now and has recently published his first book; Red Hat Enterprise Linux Troubleshooting Guide.

Publications

Identify, capture and resolve common issues faced by Red Hat Enterprise Linux administrators using best practices and advanced troubleshooting techniques

What people are saying:
Excellent, excellent resource for practical guidance on how to troubleshoot a wide variety of problems on Red Hat Linux. I particularly enjoyed how the author made sure to provide solid background and practical examples. I have a lot of experience on Red Hat but still came away with some great practical tools to add to my toolkit. - Amazon Review

Sponsored by