[plug] Which RPM?

Richard Sharpe sharpe at ns.aus.com
Tue Jun 13 15:42:22 WST 2000


At 01:02 PM 6/13/00 +0800, David Griffiths wrote:
>>I ended up using a different method. Something like:
>>
>>  cd /cdrom/Redhat/RPMS
>>  foreach f ( *.rpm ) { rpm -ql $f | gzip > /rhfiles/$f.gz }
>>
>>Now I can just "zgrep <pattern> /rhfiles/*" and get a list of the files
>>with the package names. Works for older redhats too of course. And much
>>less disk space.
>>
>Doesn't work for me Mike ("ql" lists installed package files).
>Did you mean "rpm -qpl $f" ?
>How do you get the package names printed as well with each file?

I suspect he was typing fast and forgot the p. The zgrep should provide the
package name as it is part of the file name that the file listing goes in.

Another method I use, and teach on my course, to quickly find what RPM a
file is in when you are trying to satisfy dependencies, is the following:

for f in /mnt/cdrom/<distro>/RPMS/*.rpm
do
  if [ "`rpm -qlp $f | grep <some-file>`" != "" ]; then echo $f; fi
done

It is not the be-all and end-all, but it does the job. It works for RedHat,
TurboLinux and Mandrake, AFAIK.

It will list out more than one RPM in many cases, but it is easy to pick
which one is the correct one.

>cheers,
>
>Dave.
>
>
>
> ========================================================================
>
>  David Griffiths                             griffith at environ.wa.gov.au
>
>  Air Quality Management Branch
>  Department of Environmental Protection          Phone:   61 8 9222 7151
>
>  Westralia Square                                Fax  :   61 8 9321 5184
>  141 St Georges Tce
>  Perth 6000
>  Western Australia
> ========================================================================
>
>
>
>

Regards
-------
Richard Sharpe, sharpe at ns.aus.com
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Co-author, SAMS Teach Yourself Samba in 24 Hours
Author: First Australian 5-day, intensive, hands-on Linux SysAdmin course
Author: First Australian 2-day, intensive, hands-on Samba course




More information about the plug mailing list