"alternatives" versus PATH

Chris Adams cmadams at hiwaay.net
Fri Oct 6 13:57:17 UTC 2006


Once upon a time, Edwin Olson <eolson at mit.edu> said:
> Fedora has shipped "alternatives" for a while now, but I still don't get it.
> 
> Why is "alternatives" better than setting your PATH appropriately? Why 
> should "alternatives" override your path?

Many many many shell/perl/etc. scripts and mail clients call
"/usr/sbin/sendmail" (or even still "/usr/lib/sendmail") to submit an
email message.  Any local MTA needs to provide that program, but with
RPM, you can only install one program that provides it.

With alternatives, you can (for example) install both sendmail and
postfix, and use the alternatives system to select which one is called
when "/usr/sbin/sendmail" is run.

You may want to have both installed while converting a system (so you
can be preparing and testing one as a replacement for the other).  Also,
if both included their own "/usr/sbin/sendmail", the RPMs would
conflict, making it difficult for the average user to convert from one
to the other (since both provide "smtpdaemon" which is required by a
number of other packages).  You can't "rpm -e sendmail; rpm -i
postfix*rpm" due to dependencies.  You can use the yum shell to do
things like this now, but there is no nice GUI way to do it.

> PS: My latest experience went like this:
> 
> 1. installed sun jdk to /opt/jdk
> 2. export PATH=/opt/jdk/bin:$PATH
> 3. cd into one of my java code bases
> 4. ant
> 5. gcj is invoked by ant, apparently due to alternatives.
> 6. gcj can't compile my code and I'm sad.

If you used the jpackage nosrc SRPM to install the Sun JDK, it would
have been much easier, as it properly uses alternatives to select a JDK.
-- 
Chris Adams <cmadams at hiwaay.net>
Systems and Network Administrator - HiWAAY Internet Services
I don't speak for anybody but myself - that's enough trouble.




More information about the fedora-test-list mailing list