Update Alternatives

If there are several versions of a tool installed in Redhat. Use command update-alternatives for prioritization.

For instance with Python, saying Python 2.6, 2.7 and 3.6 versions are installed. With root following bundle of commands activates Python3.6 to be the system-wide default version.

1
2
3
4
5
6
7
8
9
root@localhost# update-alternatives --display python
root@localhost# update-alternatives --install /usr/bin/python python /usr/bin/python2.6 1
root@localhost# update-alternatives --install /usr/bin/python python /usr/local/bin/python2.7 2
root@localhost# update-alternatives --install /usr/bin/python python /usr/local/bin/python3.6 3
root@localhost# update-alternatives --display python
/usr/bin/python2.6 - priority 1
/usr/local/bin/python2.7 - priority 2
/usr/local/bin/python3.6 - priority 3
Current 'best' version is /usr/local/bin/python3.6.