Update Alternatives in Debian
January 27, 2009 8 Comments
Debian can have multiple versions of the same application or even different applications of the same type. For example, there can be multiple text editors installed. If you want to pick a default application, update-alternatives is your friend. Run the command and a list should be displayed from which you make your selection. Here I will try to put commands which pick default entries for applications.
Choose default text editor:
sudo update-alternatives --config editor
Change default Python version:
sudo update-alternatives --config python
Sometimes you may get a message: No alternatives for python, if you try, say,
update-alternatives --config python. You may then have to manually add all the executable versions to the update-alternatives system. For example, if you have both Python 2.4 and Python 2.5 installed, you may want to do something like:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.4 10
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 20
Now when you run
sudo update-alternatives --config python you should be able to choose a default version. The numbers 10 (after 2.4) and 20 (after 2.5) indicate preference; higher the number, more preferred it is (at least the way I understand it).