[CentOS] How to query the package owning the file? (no packahe manger installed)

Fri Jul 15 12:33:41 UTC 2005
Johnny Hughes <mailing-lists at hughesjr.com>

On Fri, 2005-07-15 at 17:35 +0530, Prasad Pillarisetti wrote:
> Guys recently I had this question asked in a technical interview.
>  
> How do I find out the package owning a particular file, when no
> package managers are installed?
>  
> I am assuimg SRPMs are used to install the software?
>  
> Is this actually possible? Install the Linux OS without a package
> manager?
>  
> I know "rpm -qf filename" gives the package owning the file.
> But how to get the package name when I don't have any package manager?
>  
> Maybe this was a question to rattle me?
> 
> -- 
> Prasad Pillarisetti
> "If everything is coming your way, then you are in the wrong lane" 

To find the package that owns a particular file that is installed on
your system, you would do:

rpm -q --whatprovides /full/path/to/file

for example, on CentOS-4 if I do:

rpm -q --whatprovides /bin/bash

I get this as an answer:

bash-3.0-19.2


OR ... 

rpm -q --whatprovides /usr/lib/rlm_expr.so

provides this:

freeradius-1.0.1-3.RHEL4


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.centos.org/pipermail/centos/attachments/20050715/fd4f19b8/attachment-0004.sig>