First of all, you need to install the python3
package. After installing it, go to a terminal and type:
sudo update-alternatives --config python
then choose python3 from the list that's presented.
If it does not work, you may need to recreate the symlink. First save it:
sudo mv /usr/bin/python /usr/bin/pythonSAVE
afterwards, create the alternatives:
sudo update-alternatives --install python2.5 python /usr/bin/python2.5 2
sudo update-alternatives --install python3.1 python /usr/bin/python3.1 1
create a new symlink:
sudo ln -s /etc/alternatives/python /usr/bin/python
Finally, choose the one (python3) you want to use:
sudo update-alternatives --config python
And if you need to go back to python2, just repeat the command:
sudo update-alternatives --config python
I guess just install the package and update-alternatives will work very well, you may don't need to recreate links from scratch. Thanks!
EDIT: As pointed out here the update-alternatives
with the --install
options accepts an absolute link, so you may need to run:
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.5 2
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.1 1