Yum – find out which RPM package provides particular file or command

Aug 3, 2016 Linux

Yum – find out which RPM package provides particular file or command
Have you ever wondered how to find RPM package which contains particular script, application or command in your RedHat / CentOS or any other Yum / RPM based operating system? Have you ever needed to find the RPM package which provides some service or feature?

Yum package manager provides parameters to fast and easy search for particular files / features in Red Hat / CentOS RPM repositories:

[root@tuxfixer ~]# yum provides {package-name}
[root@tuxfixer ~]# yum whatprovides {package-name}

Example:

[root@tuxfixer ~]# yum whatprovides iostat
Loaded plugins: product-id, search-disabled-repos, subscription-manager
sysstat-10.1.5-4.el7.x86_64 : Collection of performance monitoring tools for Linux
Repo        : rhel-7-server-rpms
Matched from:
Filename    : /usr/bin/iostat

sysstat-10.1.5-7.el7.x86_64 : Collection of performance monitoring tools for Linux
Repo        : rhel-7-server-rpms
Matched from:
Filename    : /usr/bin/iostat

Once you know what RPM package provides sought command, feature, script or application, you can simply install it:

[root@tuxfixer ~]# yum install sysstat

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.