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?
On Friday 15 July 2005 08:05, Prasad Pillarisetti wrote:
How do I find out the package owning a particular file, when no package managers are installed?
If RPM is not installed, then no package can own a file since packages do not exist.
Maybe you should have answered: Google!
Simon Perreault wrote:
On Friday 15 July 2005 08:05, Prasad Pillarisetti wrote:
How do I find out the package owning a particular file, when no package managers are installed?
If RPM is not installed, then no package can own a file since packages do not exist.
Maybe you should have answered: Google!
Indeed. I was scratching my head wondering why anyone would expect to get a "package name" for a file when it was not placed on the file system by a package manager. There's no automated way to determine which software installation owns a particular file if you don't have a suitable package management system installed. So, yes, it sounds like a trick question or (more likely) an inexperienced person or PHB doing the interviewing.
Cheers,
C
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
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
rpm -qf /path/to/file
will give you the same results
-Jay
Johnny Hughes wrote:
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
The question was "... whithout having a package manager installed (ie no rpm).
On Fri, Jul 15, 2005 at 01:53:23PM -0400, Ugo Bellavance wrote:
The question was "... whithout having a package manager installed (ie no rpm).
How can a package own a file without a package manager?
Alan Hodgson wrote:
On Fri, Jul 15, 2005 at 01:53:23PM -0400, Ugo Bellavance wrote:
The question was "... whithout having a package manager installed (ie no rpm).
How can a package own a file without a package manager?
eh. It was a trick... a trap question.
Ugo Bellavance wrote:
The question was "... whithout having a package manager installed (ie no rpm).
This is also answer to everybody else who was nitpicking...
I believe that OP ment a GUI front end when he said "no package manager". If he's running CentOS, then he has rpm installed, and most of his system (if not everything) was installed by rpm. I fail to understand why so many people are trying to be smart, instead of being helpfull. Luckily, at least Jay (haven't checked entire thread, maybe there were others) gave a helpfull answer (hint to the OP, "man rpm" contains answer to your question, as well as many other usefull options for rpm command).
You know, there's difference between "smart" and "smart ass". Nitpicking will more often get you closer to later then the former ;-)
Aleksandar Milivojevic wrote:
Ugo Bellavance wrote:
The question was "... whithout having a package manager installed (ie no rpm).
This is also answer to everybody else who was nitpicking...
I believe that OP ment a GUI front end when he said "no package manager". If he's running CentOS, then he has rpm installed, and most of his system (if not everything) was installed by rpm. I fail to understand why so many people are trying to be smart, instead of being helpfull. Luckily, at least Jay (haven't checked entire thread, maybe there were others) gave a helpfull answer (hint to the OP, "man rpm" contains answer to your question, as well as many other usefull options for rpm command).
You know, there's difference between "smart" and "smart ass". Nitpicking will more often get you closer to later then the former ;-)
I tried to help. This is not a _real_ question. It is a question that has been asked in a job interview. A trap. Please re-read the thread. If you don't understand, just go to the next thread, it is not very important.
Regards, Ugo
Quoting Ugo Bellavance ugob@camo-route.com:
I tried to help. This is not a _real_ question. It is a question that has been asked in a job interview. A trap. Please re-read the thread. If you don't understand, just go to the next thread, it is not very important.
In which case, the person being interviewed will loose wichever answer he gives.
If he answers "you can't without package manager", it just means he doesn't know how to deal with fuzzy (to use the nice word) problem descriptions from clueless (to use not-so-nice word) co-workers.
If he answers "rpm -e", than he doesn't know what is package manager.
See... You loose both ways.
The only right thing to do when question like that pops up during an interview is to smack the person that asked the question with a large trout right onto his head ;-). If he has a bold spot, aim for it. Probably won't get you the job (or maybe it will, you never know), but hopefully the person conducting interview will realize it was not really that smart question :-)
Of course, this assumes you rememered to bring a trout with you. Which will also show you are pendatic and always prepared.
---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.
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?
If it was a system using deb packages, you could go to /var/lib/deb and search there I think.
I am assuimg SRPMs are used to install the software?
rpm is not the only packaging system available. Is the question generic or related to a particular flavour of Unix/Linux?
Is this actually possible? Install the Linux OS without a package manager?
Linux is a kernel. If floppy based Linux distributions are anything to go by, I would say yes.
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?
Depends on the packaging system. Never tried looking inside /var/lib/rpm files...
Maybe this was a question to rattle me?
Or the interviewer is very savvy.
On 7/15/05, Prasad Pillarisetti prasad.pillarisetti@gmail.com 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?
Ummm.... Ask on the distribution's mailing list???
Maybe this was a question to rattle me?
Or to see how resourceful you are.
On Thu, 2005-08-04 at 00:09 -0500, Les Mikesell wrote:
Ummm.... Ask on the distribution's mailing list??? Or to see how resourceful you are.
Actually, this just occurred to me. He could have been talking about using Emerge. It actually runs on RPM and DPKG distros (and not just Gentoo), and it's not a bad tool for managing source.
If there is any constant in the universe, the best concepts seem to filter into all distros. I don't like the "choice of distros" non-sense because it a leftover of "brand name marketing" from the commercial world. I like focusing on "choice of technologies," and a lot of distros do overlap.
Of course, the guy could have been a Gentoo bigot^H^H^H^H^H marketeer.** There are Gentoo users. And then there are Gentoo mod-car kiddies. And then there are just right-out bigots.
5 years ago they would have been Debian bigots claiming that RPM is dependency hell and bloated. Now they are Gentoo bigots claiming even Debian is dependency hell and bloated.
REALITY: Ports and Packages distros have their respective places. I use _both_ quite effectively. Emerge could prove quite useful in managing Java, Perl, Python and other development frameworks on Red Hat distributions, as well as getting rid of the redistribution issues.
So he might have been legitimately looking for Emerge. Or he could have really hated Red Hat/Debian and think it's a better way as a distro altogether, and wishes the company goes Gentoo. There are a lot of them right now (just like Debian 5 years ago).
For more, see my Blog (this is a massive 7,600 word rambling that I'm going to "clean up" and shape into a 3,000 word article): http://thebs413.blogspot.com/2005/07/linux-distributions-packages-v-ports.ht...
** DISCLAIMER: I am _both_ a Gentoo user and a 11-year FreeBSD user. I not only wrote the appendix on [Free]BSD in Samba Unleashed which touted its "ports" system, but I worked on that same book with Gentoo co-founder Daniel Robbins (not personally, just as another contributing author). I was happy to see Daniel come up with the first major "ports" distro in Gentoo. So when I say 'bigot' I neither mean it to represent all nor even a majority of Gentoo users.
On Thu, 2005-08-04 at 00:49, Bryan J. Smith wrote:
Of course, the guy could have been a Gentoo bigot^H^H^H^H^H marketeer.** There are Gentoo users. And then there are Gentoo mod-car kiddies. And then there are just right-out bigots.
Sorry, but I don't think a distribution that makes you build your own system by following rambling documentation interspersed with example commands instead of just putting the commands in an executable script quite understands how unix users like to do things...
On Thu, 2005-08-04 at 00:58 -0500, Les Mikesell wrote:
Sorry, but I don't think a distribution that makes you build your own system by following rambling documentation interspersed with example commands instead of just putting the commands in an executable script quite understands how unix users like to do things...
???
"Ports" distros are actually a throwback to many UNIX concepts. Gentoo's Emerge is nothing new, and FreeBSD's ports work similar.
I think "ports" distros have much to offer for many things. And Emerge _is_ scripts.
The problem is that people "oversell" what "ports" based distros do. "Packages" distros are very capable in many areas.
Again, I break them down in my blog.
On Thu, 2005-08-04 at 01:16, Bryan J. Smith wrote:
Sorry, but I don't think a distribution that makes you build your own system by following rambling documentation interspersed with example commands instead of just putting the commands in an executable script quite understands how unix users like to do things...
???
"Ports" distros are actually a throwback to many UNIX concepts. Gentoo's Emerge is nothing new, and FreeBSD's ports work similar.
Oh emerge itself is fine - I mean what you have to do to get to a point where you can use it. Where's the kickstart equivalent?