Bug 1020

Summary: Can't query "which uninstalled package supplies file XXXX?"
Product: [Retired] Red Hat Linux Reporter: perry_hutchison
Component: rpmAssignee: Jeff Johnson <jbj>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: 5.1CC: dshindeit
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-05-16 21:32:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description perry_hutchison 1999-02-01 23:09:02 UTC
I have not been able to find a way of asking RPM to search
through a collection of _uninstalled_ rpm files, and report
which (if any) of them contains a particular file.  The
closest I have gotten is

  cd /mnt/cdrom/RedHat/RPMS
  rpm -q -p *.rpm -l | egrep {pattern}

which will dump all file names from the entire distribution
and show those that match the {pattern}, but it doesn't
show which rpm I would need to install to get the selected
file(s).

I had first tried

  rpm -q -p *.rpm -f {name}

but this complains:

  rpm: one type of query/verify may be performed at a time

I have now run into a need for this sort of query twice,
most recently to find out which source rpm contains
loadlin.  I think the answer may be that the distribution
does not provide the loadlin source code :( which is not
good because there appears to be a bug in it :(((

Comment 1 Jeff Johnson 1999-02-11 18:30:59 UTC
Try
	rpm -qp --queryformat '[%{=NAME}: %{FILENAMES}\n]' *.rpm
| 	           grep ...
(from "Maximum RPM" pg 73).

Comment 2 perry_hutchison 1999-02-11 20:15:59 UTC
That's a pretty slick capability -- maybe it could be added to the
manpage?  I just looked at the 19 August 1997 version as displayed
by "info rpm", and if it's there I couldn't find it, nor any mention
at all of using "[" in --queryformat.

Comment 3 Jeff Johnson 1999-03-22 20:07:59 UTC
The man pages for rpm will be reworked in the next month or so.

Comment 4 Jeff Johnson 1999-05-16 21:32:59 UTC
Man pages are reworked. The use of the iterator is best found
by reading Maximum RPM. A new version is due out in the next couple
of months.