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.
Today’s modular x86 servers are compute-centric, designed as a least common denominator to support a wide range of IT workloads. Those generic, virtualized IT workloads have much different resource optimization requirements than hyperscale and cloud applications. They have resulted in a “one size fits all” enterprise IT architecture that is not optimized for a specific set of IT workloads, and especially not emerging hyperscale workloads, such as web applications, big data, and object storage. In this report, you will learn how shifting the focus from traditional compute-centric IT architectures to an innovative disaggregated fabric-based architecture can optimize and scale your data center.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
| Non-Linux FOSS: Seashore | May 10, 2013 |
| Trying to Tame the Tablet | May 08, 2013 |
- RSS Feeds
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
- New Products
- Validate an E-Mail Address with PHP, the Right Way
- Drupal Is a Framework: Why Everyone Needs to Understand This
- A Topic for Discussion - Open Source Feature-Richness?
- Tech Tip: Really Simple HTTP Server with Python
- Home, My Backup Data Center
- New Products
- Android is Linux -- why no better inter-operation
14 min 55 sec ago - Connecting Android device to desktop Linux via USB
43 min 25 sec ago - Find new cell phone and tablet pc
1 hour 41 min ago - Epistle
3 hours 10 min ago - Automatically updating Guest Additions
4 hours 18 min ago - I like your topic on android
5 hours 5 min ago - Reply to comment | Linux Journal
5 hours 26 min ago - This is the easiest tutorial
11 hours 41 min ago - Ahh, the Koolaid.
17 hours 19 min ago - git-annex assistant
23 hours 19 min ago
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Free Webinar: Linux Backup and Recovery
Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.
In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.



Comments
Correction for "Another way"
D**n... Missed the stated intent of searching uninstalled packages.
The "--whatprovides" switch naturally only searches packages already installed on the system, not the package files.
Sorry for that.
Another way to find the file.
Or You could just use RPM's database.
rpm -q --whatprovides FILES_TO_SEARCH_FOR
Other Usefull rpm commands
Same as:
rpm -qlp RPMS-TO-SEARCH | \
grep FILE-TO-SEARCH-FOR
q - query
l - list files
p - packages
Good ones are:
--------------
1. Find the rpm which FILE (path/filename) belongs to
rpm -qf FILE
2. Verify rpm files (changes, MD5, permissions, owner, ...)
rpm -qV RPM_PACKAGE_NAME
3. List packages ordered by SIZE
rpm -qa --qf "%{SIZE} %{NAME}\n" | sort -n
4. Repackage OLD files (make rollback rpm) when upgrading an rpm
rpm --repackage -Uvh NEW_RPM_PACKAGE
rpm -qlp RPMS-TO-SEARCH |
rpm -qlp RPMS-TO-SEARCH | grep FILE-TO-SEARCH-FOR will tell you the file name, the directory it will be installed on, and that there is a package containing it, but won't tell you which package is.