DON'T PANIC

Using the Debian alternatives system

Posted on: October 18, 2011


update-alternatives

There are many classes of applications which have many programs that can be used, Debian allows you to choose which particular alternative you wish to be used, globally. This covers a set of programs such as: text-editor, web-browser, windows-manager, x-session-manager, etc.

The way it works is to have a set of standard command names such as editor, www-browser, and view. Each of those commands are merely symobilic links to the real command.

For example assume you have both the vim and emacs21 packages installed. To handle this a program that wishes to allow you to edit a file merely runs:


/usr/bin/editor

This is a symbolic link which links to:

/etc/alternatives/editor

This in turn links to the real editor, either vim or emacs in our example.

So, to set you preferred text-editor, you could update the symbolic links by hand, but the preferred approach is to run:


$update-alternatives --set editor /usr/bin/emacs21

To list which are the options you have:

$update-alternatives --list editor
/usr/bin/vim
/usr/bin/emacs21

You can set other applications, replacing editor by: x-www-browser, x-session-manager, etc.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Advertisements

  • None
  • analialorenzatto: Buzz is just a host name for this example, it doesn't have any relation to the topic. Instead of being "Buzz", could be whatever name.
  • fridelain: >buzz What's the story behind this host name? Actully running buzz, once running buzz and upgraded many times since, or unrelated to debian naming
  • Pratik: Nice, but I would change it to include more directories. Like my .mozilla and .kde4 by using .{config,mozilla,kde4} instead of just .config .

Categories

%d bloggers like this: