When there is a command in the system, you can use rpm-qf/path/to/command to find the package for which the command was installed. However, if the command to be used does not exist, how can we find the software package that provides the command.
Yum can solve this problem
# yum help | grep providesprovides Find what package provides the given value
For example, you need to find the command that provides the genhash command,
# yum provides */genhashkeepalived-1.2.7-3.el6.x86_64 : High Availability monitor built upon LVS, VRRP and service pollersRepo : CentOS64Matched from:Filename : /usr/bin/genhash
Note: */or * bin/must be added before the content to be searched; otherwise, the content may not be found.
# yum provides genhash Warning: 3.0.x versions of yum would erroneously match against filenames. You can use "*/genhash" and/or "*bin/genhash" to get that behaviourNo Matches found
This article is from the foolishfish blog, please be sure to keep this source http://foolishfish.blog.51cto.com/3822001/1439302