Product SiteDocumentation Site

5.2.5. Determining which package provides a certain capability

To complete the circle, you can query for which package provides a certain capability. This knowledge allows you to trace a requirement back to the package that provides it.
The --whatprovides option tells the rpm command to list the capabilities a package provides. Use the --whatprovides option with the –q, or query, option to the rpm command. (There is no short form for the --whatrprovides option.)
The basic syntax follows:
rpm –q --whatprovides capability
For example, to query what package provides the capability webserver, use the following command:
$ rpm -q --whatprovides webserver
In this case, the capability is identified by an arbitrary string, webserver. This is a generic name for a given capability, serving Web pages.
You can also trace individual files using the --whatprovides option. For example:
$ rpm -q --whatprovides /etc/skel/.bashrc
The rpm –qf command, covered in the last chapter, is an easier way to get to the same information when tracking which package provides a particular file. For example:
rpm -qf /etc/skel/.bashrc
If you are querying particular files, use rpm –qf. If you are querying capabilities, use --whatprovides.