[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: How to query the package owning the file? (no package manger installed)



On Fri, 2005-07-15 at 17:40 +0530, Truejack wrote: 
> 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?

Off of the top of my head, I would probably have said that the idea of a
"package" pretty well implies package management of some form. I would
have asked them to clarify what "package" meant, and whether there was
ever a package manager on the machine in the first place. I would ask
whether it was a machine which I maintained, in which I'd have kept a
list somewhere, or a machine I was seeing for the first time.

If there may have been a package manager originally, I'd egrep
around /var and try to find mention of the file somewhere. If I knew
which package manager was initially used to install the package I'd add
some use of the find command to try to locate the relevant location so I
wasn't needlessly searching all of /var. Otherwise I'd just poke
around /var for a relevant starting point, or grep the whole tree. If
there wasn't a package manager us, you may be reduced to Google
searches, or use of "locate" in hopes that a source tree is still laying
around somewhere that might indicate what the file is associated with.

To me, for a file to be part of a package (as opposed to just having
been installed by a script or "make install") implies a tracking
mechanism. Otherwise the concept of a package isn't appropriate. It
seems inaccurate to refer to "a group of files which were copied to
various places in the filesystem at the same time" as a package.

Just my two cents, and I'd be interested to see what others have to say.
I often make the mistake of taking people too literally, which means
that I tend to read more into questions than others normally do.

Chet


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]