Finding Which RPM Package Contains a File

To search a list of RPM files for a particular file, execute the following command:

$ ls RPMS-TO-SEARCH | \
    xargs rpm --query --filesbypkg --package | \
      grep FILE-TO-SEARCH-FOR

Replace RPMS-TO-SEARCH with the names of the RPM files to search, and replace FILE-TO-SEARCH-FOR with the name of the file to search for. The --filesbypkg option tells the rpm command to output the name of the package as well as the name of the file.

Load Disqus comments