There are alternative applications for many standard applications. After all, what UNIX programmer can't think of a better or different way of doing something? But how is that choice of alternatives easily managed on a Linux system? In the old days, the sysadmin installed the alternative application and created a symlink to the alternative application in place of the expected default application, for example symlinking /bin/mail to /usr/bin/sendmail.
But the update-alternatives method provides better control, in theory at least.
My problem was that the default installation of Mandriva Linux (as of Mandriva-2010) did not provide such a choice. I filed a bug report about it since it should be an available choice from a base installation. If you install any application and intend to use it as an alternative, but it does not show up as an available choice, look at my bug report for an example one one that will be accepted as complete and then report your own experience as a bug. Here's how I added it manually and how you can add any alternative to your system.
The alternative links themselves are kept in /etc/alternatives. To see if any alternatives are available for a command, enter:
# update-alternatives --list
If the choice you seek is not listed, you may add it manually, using /bin/mail as an example, by entering:
# update-alternatives --install /etc/alternatives/sendmail-command sendmail-command /bin/mail 1
Two things of note here. For unexplained reasons, sendmail is identified as sendmail-command. The priority number helps order your choices and sets the default; the higher the number, the higher the priority. I assigned priority 1 to /bin/mail because it is the least powerful of all the choices that there could be.
To select among possible choices, enter:
# update-alternatives --config sendmail-command
Which provides the following response:
There are 2 programs which provide `sendmail-command'.
+ 1 /usr/sbin/ssmtp
Enter to keep the default[*], or type selection number:
And I chose 2.
While there is a man page with a good description of all the options, a lot of information is contained within /usr/sbin/update-alternatives itself since it is a perl script.