using update-alternatives

I have several version of octave now, and I do not want to remove the older version yet. Debian system provides a nice command called update-alternatives where it can choose from several alternatives the program you want to use. for example in the case of octave. It will create a symbolic link in /usr/bin/octave that points to /etc/alternatives/octave. This in turns link to the choice of octave we want.

To install a new version of octave to the alternative system:

sudo update-alternatives --install /usr/bin/octave octave ~/Programs/Octave-3.2.4/bin/octave 4

The number at the back is the priority number. Now to choose the default octave we want to load:

sudo update-alternatives --config octave

This will display:
There are 4 alternatives which provide `octave’.

Selection Alternative
+ 1 /usr/bin/octave-2.1.73
2 /home/kurniawano/Programs/Octave3.0.1/bin/octave
* 3 /home/kurniawano/local/bin/octave
4 /home/kurniawano/Programs/Octave-3.2.4/bin/octave

Press enter to keep the default[*], or type selection number: 4
Using ‘/home/kurniawano/Programs/Octave-3.2.4/bin/octave’ to provide ‘octave’.

Of course in the above I choose the newly installed version.

to remove an option, you can use:

sudo update-alternatives --remove octave /home/kurniawano/Programs/Octave3.0.1


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: