[TriLUG] good newbie book

Mike Broome mbroome at employees.org
Wed Nov 28 16:25:18 EST 2001


On Wed, Nov 28, 2001 at 10:06:52AM -0700, Ed Hill wrote:
> Lisa Lorenzin wrote:
> > can anyone tell me how to use rpm (the command) to determine what rpm
> > (package) contains the library i need, when the rpms (packages) are on the
> > cd, rather than installed?  specifically, i want the moral equivalent of
> > rpm -qp --whatprovides libfoo.so.1, but when i try that, it tells me i can
> > only do one type of query at a time.  (sigh.)
> 
> 
> for i in *.rpm
> do
>    n=`rpm -qlp $i | grep libfoo | wc -l`
>    if [ $n -ne 0 ]; then
>      echo $i
>    fi
> done


That's pretty much sums up what I ended up writing.  Plus being able to
pass in a string to search for and a list of files (or a glob) to search
over.  Then I added some status messages so you knew it was actually
doing something (since it takes a looong time to grub through all the
RPMs on a 2x CDROM on a P100).  When I started trying to build up a list
of filenames to display after the loop, I decided that I should have
written it in Perl. :)  But it worked.  I *love* a programmable shell.

But we were wondering if there is a way of doing that without leaving
the confines of rpm.  Or if there's a practical way of doing that for
people who don't write shell scripts.  It seems like the RH installer
(Anaconda?) does this for you when you get to the end of the install and
it tells about the dependencies you are missing and can automagically
install the needed rpms.  Anyone know if there's anyway to get that
functionality (or get the rpm install part of the installer) after the
initial install?

Mike

-- 
Mike Broome
mbroome(at)employees.org



More information about the TriLUG mailing list