Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

As far as I understand, /etc/alternatives stores only currently selected alternatives. Where are all the variants and all the metadata stored? I have accidentally removed an alternative with galternatives and want to add it back as it was manually (as galternatives functionality is very limited).

share|improve this question

This data seems to be in /var/lib/dpkg/alternatives, also check man update-alternatives for more information.

share|improve this answer

The command-line update-alternatives tool should help you here.

This command should take you through all alternatives one at a time:

update-alternatives --all

There are some more examples at this wiki page which can show you all manually-set alternatives and even (use with caution!) reset all those to their defaults.

A more detailed description of how the alternatives system works, including where it stores all its configuration, is available in the update-alternatives manpage (note that this version for Debian and Ubuntu contains more functionality than the update-alternatives from redhat).

share|improve this answer

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.