On Wednesday 17 July 2002 10:31 am, mukund wrote:
> Assuming X is not installed..
> The dependency failure in rpm gives file name (and not packages) which
> causes lots of frustration to newbie, because they have no other way but
> rpmfind.net.
This is not true. There are indeed other ways. If you say that there are no
other ways, then you haven't read the documentation - and that further
implies that you are blaming the tool for your inability/reluctance to
practise. :-( The --redhatprovides option to RPM (described down below)
is there to do precisely this.
First of all, let me make some points.
1. apt-get install (or something similar) will install a package and all its
dependencies.
Let us say that I package fubar-1.0 as a .deb, and it depends on libfubar-0.2.
I put up on a server just fubar-1.0, and ask you to add the entry to you
/etc/whatever file, and do apt-get install. Since I have not put up libfubar,
your installation will ALSO fail because of dependency problems. There is no
escape from this.
The apt-get install method works seamlessly only when you use the debian
official distribution channel (which I suppose, goes through the stringent QA
exercise debian is famous for). With arbitrary third party .deb repositories,
chances are that you too will face dependency troubles.
Now, that is also true of RedHat if you use the RedHat installation CDs, and
ftp.redhat.com, updates.redhat.com and rawhide. They have no reason to
support RPMs out there in the wild.
2. RPM is used by a variety of distributions; not just RedHat. It is quite
likely that an RPM built on a Mandrake system will not work on a RedHat
system. Indeed, if I am planning to use a Mandrake RPM, then I usually make
sure I get the source RPM and try to build it myself (Mandrake uses a few
extra rpmmacros that are not present in RedHat, so the specfiles usually need
some editing).
Now, taking only RedHat - one of the points raised is that a package while
installng only mentions file names and not packages. It is so painfully
obvious that you haven't read the RPM help - here's a snippet:
binand@binand[~]:(9) rpm --help
[snip]
--redhatprovides find package name that contains a provided
capability (needs rpmdb-redhat
package installed)
So, let us try on a machine:
[root@kappa root]# rpm -i --test koffice-1.1.1-5.i386.rpm
error: failed dependencies:
kdelibs is needed by koffice-1.1.1-5
libDCOP-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkdecore-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkdefx-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkdeprint-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkdesu-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkdeui-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkio-gcc2.96.so.4 is needed by koffice-1.1.1-5
libkparts-gcc2.96.so.2 is needed by koffice-1.1.1-5
libmng.so.1 is needed by koffice-1.1.1-5
libqt-mt.so.3 is needed by koffice-1.1.1-5
libkspell-gcc2.96.so.4 is needed by koffice-1.1.1-5
Ok, now:
[root@kappa root]# rpm --redhatprovides libDCOP-gcc2.96.so.4
kdelibs-3.0.0-10
[root@kappa root]# rpm --redhatprovides libmng.so.1
libmng-1.0.3-2
And so on. Admitted its a bit convoluted, but then the RPM tool is powerful
enough for you to script it all.
So, here is my first effort:
binand@binand[~]:(11) cat bin/whatmore
#!/bin/bash
for depend in $( rpm -qp --qf "[%{REQUIRENAME}\n]" $1 ); do
check=$( echo $depend | sed -e 's,^rpmlib.*$,___,' );
[ $check = "___" ] && continue;
rpm -q --whatprovides $depend &>/dev/null || rpm --redhatprovides $depend;
done | sort -u
A test:
[root@kappa root]# whatmore koffice-1.1.1-5.i386.rpm
kdelibs-3.0.0-10
koffice-1.1.1-5
libmng-1.0.3-2
qt-3.0.3-11
It says I need these packages installed to install koffice. An enhancement to
the script would be to remove whatever koffice provides from the dependency
list the script generates - left to the reader as an exercise ;-)
Binand
--
If you found this helpful, please take some time off to rate it:
http://svcs.affero.net/rm.php?r=binand
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
linux-india-help mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/linux-india-help