[TAG] Fedora questions
Benjamin A. Okopnik
ben at linuxgazette.net
Fri Nov 18 22:36:31 MSK 2005
On Fri, Nov 18, 2005 at 01:25:12PM +0100, Didier Heyden wrote:
> On Thu, Nov 17, 2005 at 10:45:45PM -0800, Mike Orr wrote:
> > On 11/17/05, Pete Savage <debug at silentkeystroke.co.uk> wrote:
> > > Pedro Fraile wrote:
> > > >
> > > > I think what you are looking for is
> > > >
> > > > rpm -qf <your file name here>
> > > >
> > >
> > > I think the f parameter is used to specify a file for rpm to query,
> > > hence the following;
> > >
> > > [pete at localhost ~]$ rpm -qf gdmgreeter
> > > error: file /home/pete/gdmgreeter: No such file or directory
> > > [pete at localhost ~]$
> >
> > BTW, both dpkg and Gentoo have this feature.
> >
> > ``
> > # List the package owning file 'foo'.
> > dpkg -S foo
> > qpkg -f foo
>
> With rpm, you have to provide a path to an existing file. It only works
> for installed packages.
>
> ``
> fakir at wallace:~$ rpm -qf /usr/bin/gdmgreeter
> gdm-2.6.0.5-6
> ''
Hey, Didier! Good to hear from you.
I don't know if this option is available with Fedora, but with Debian,
one of the most useful resources I have for tracking down "missing"
files or libraries required for compilation is
1) Downloading the "Contents-i386.gz" once every few months, and
2) Running the following script whenever I need to locate the package
for a given file:
----- pkgf.sh.txt -----------------------------------------------
#!/bin/sh
# Created by Ben Okopnik on Sat Sep 15 09:32:06 UTC 2001
[ "$1" ] || { printf "${0##*/} <keyword>\t\tsearch for keyword\n\
${0##*/} -p <keyword>\tsearch for package name\n"; exit; }
if [ "$1" = "-p" ]
then
zgrep "/$2[^/]*$" /home/ben/Debian/Contents-i386.gz|less
else
zgrep "$1" /home/ben/Debian/Contents-i386.gz|less
fi
----- pkgf.sh.txt -----------------------------------------------
So, "pkgf foo" will give me a list of all files _and_ packages
containing "foo" in the name, and "pkgf -p foo" will show me all the
matching packages and the files contained in them.
* Ben Okopnik * Editor-in-Chief, Linux Gazette * http://linuxgazette.net *
More information about the TAG
mailing list