Use update-alternatives to upgrade maven installation on Ubuntu.
Use debian update-alternatives to easily swith from different version of the same program you have installed on your machine. Or, more frequently, just to switch to a new version in a fast and clean way.
Let's make a simple example with maven. Ubuntu repositories have an old version and I want to use the new one with the same comfort of the packaged one. Here we go.
Now, from a terminal:# sudo update-alternatives --config mvnyou will see what you have installed and configured and what is the actual default version (the one with the *) to install the new version:# sudo update-alternatives --install /usr/bin/mvn mvn /home/ildella/software/apache-maven-2.2.1/bin/mvn 1now again: # sudo update-alternatives --config mvnyou will see another options, choose the right number and that's it! From now on, the "mvn" command will be binded to the 2.2.1 version of the program.
Here is the screenshot of my whole terminal session.
