Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The alternatives command (package chkconfig) on RHEL manages symlinks which link a generic name to one of the alternative implementations. For example, mta group of symlinks can be provided by Sendmail and Postfix (to implement i.e. sendmail command):

alternatives --display mta

While I can --display a group of symlinks, I need to guess its name first (i.e. mta).

Can I simply list all possible configurable symlink groups (like mta) to pick from?

The reason is that I forget some group names occasionally.

share|improve this question
up vote 8 down vote accepted

The exact answer is:

ls /var/lib/alternatives

Directory /etc/alternatives maintains flat long list of all symlinks mixing masters and slaves together. Slave symlinks cannot be used with alternatives --display [symlink] command.

At the same time directory /var/lib/alternatives contains status information (including master-slave relationship) for each group in shortened list of file names all of which can be directly used with --display option. For example, /var/lib/alternatives/java:

alternatives --display java
share|improve this answer
On Ubuntu 12.04, there is no /var/lib/alternatives, it seems to be /var/lib/dpkg/alternatives. – Hibou57 Jul 12 '14 at 8:59

The simplest answer would be...

ls /etc/alternatives
share|improve this answer
It's always more obvious when you already know the answer :) – gparent Mar 5 '13 at 16:06
It was also my first guess. But it didn't satisfy me. The list is too long containing master and slave links altogether. – uvsmtid Mar 7 '13 at 3:18

On Ubuntu 12.04 (may be some prior versions too, to be checked) and probably Debian too (to be checked):

ls /var/lib/dpkg/alternatives

List it just to get configurable alternative names, as entries in this directories are not links. By the way, there may be compressed file in this directory, so the names listed there, can't always be used as‑is. Ex. I have a /var/lib/dpkg/alternatives/psql.1.gz

share|improve this answer
Not really helpful, as the question clearly states that it applies to RedHat Enterprise Linux. The RHEL way of configuring is properly described in the other answers. – Kosi2801 Nov 17 '14 at 16:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.