
How create a new alternatives python and install Python 2 interpreter /usr/bin/python2 as an alternative with the priority 10 as follows:
The Python version that will be used by default can then be readily adjusted and it can also be switched simply. You can create a new Python executable ( /usr/local/bin/python) and add every Python version that is currently available to the alternatives database by using the update-alternatives command. Let's say you have Python 2 and Python 3 installed on your PC as an example.
The general syntax of update-alternatives command:
Docker - docker run cmd.cat/update-alternatives update-alternatives. Debian/Ubuntu/Raspbian - apt-get install dpkg. The update-alternatives command is a part of a package manager utility and it is installed with dpkg/ chkconfig package: This provides system users the option to choose their editor of choice if they so choose, but also makes it challenging for a program to choose an editor to invoke if the user has not indicated a specific preference How to install update-alternatives command? For instance, many systems simultaneously have multiple text editors installed. Multiple programmes that perform the same or related functions may be installed simultaneously on a single system. The symbolic links that make up the package alternatives system are created, removed, maintained, and shown using the update-alternatives command.
If you have two or more versions of the same command, you can quickly switch between them and choose which one to run by default by using update-alternatives.