4

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).

Ivan
  • 57,065

2 Answers2

1

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

roadmr
  • 34,222
  • 9
  • 81
  • 93
1

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).

thomasrutter
  • 36,774