Does anyone know the rpm syntax for locating a package when all you have is a file name? The package that I am searching for is not installed, but I am looking for a particular file.
and type in the filename. It should give you a list of packages containing the file.
If you have the package installed and what to find out which package it belongs to, execute
[tt]rpm -q --whatprovides <filename>[/tt]
You mean to tell me that there is no RPM option to search for which not-installed RPM has a particular file? I have to resort to a web site for this?
I found what seems to be what I am looking for, but I couldn't get it to work.
rpm -qf 'rpm -qla | grep -I bash' | more
When I ran the above command, it gave me an error indicating that it could process the command. What puzzles me about this is that its straight out of "Red Hat Linux6 for Small Business" book.
Does anyone know what I may be doing wrong? Could it be a problem because I am using Red Hat 8? Any alternative command options?
Unless you have installed the RPM database, how can the RPM system know which package contains a certain file?
Most likely that command doesn't work because the version of RPM has changed from 3.x in RedHat 7.x to 4.1 in RedHat 8.0.
Gary are you trying to say that if you have a bunch of rpm files in a directory, how do you check to see which one contains a file? If you don't already have the rpm file, than I'd go with Daniel's method.
Yes, unfortunately, I realized that the command I previously suggested will not do what I am asking.
RE: Daniel
--- "Unless you have installed the RPM database, how can the RPM system know which package contains a certain file?"
That's exactly my question and issue. If I can perform the following...
"rpm -qpl *"
The above command should list all files contained in all local rpm's (files only, not installed) and their respective path. I can go even further and limit the output to the file I am looking for...
"rpm -qpl * | grep myfile"
I know this is probably obvious to you all, but this is where my frustration seems to begin. All the above statement does is tell me if at least one of the rpm's in that folder contains the file I am looking for, not which RPM.
I have been studying diligently for the Linux+ exam and I couldn't believe that there wasn't anything in my study materials that revealed a solution. Any further insight?
Anyhow, I really appreciate everyones response and examination of this issue. Thanks.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.