Tuesday, August 3, 2010

Update-alternatives

If you have installed two versions of the application and you need to switch between them - there's a nice tool: update-alternatives. How to use it? Here's an example: switching between gcc-4.3 (and simultaneously g++-4.3) and gcc-4.4 (g++-4.4):


  1. $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.3 60 --slave /usr/bin/g++ g++ /usr/bin/g++-4.3

  2. $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.4 40 --slave /usr/bin/g++ g++ /usr/bin/g++-4.4

  3. $ sudo update-alternatives --config gcc


No comments:

Post a Comment