How to install a newer version of Python using apt-get?

Published on Author Code Father
How to install a newer version of Python using apt-get?

Felix Krull runs a PPA offering basically any version of Python (seriously, there is 2.3.7 build for vivid…) for many Ubuntu releases at https://launchpad.net/~fkrull/+archive/ubuntu/deadsnakes.

Do the usual:

sudo add-apt-repository ppa:fkrull/deadsnakes
sudo apt-get update
sudo apt-get install python3.5

It will not overwrite your existing python3.4 which is still symlinked as python3.

DON’T change the symlink! There are apparently many system functions that don’t work properly with python3.5.

I tried this and afterwards couldn’t open a terminal, software updater,…

cd /usr/bin
sudo rm python3

The upgrade to Wily will adapt the meta-package python3 to point to python3.5. I don’t expect any breakage, but at this point the foreign repository is not needed anymore. So to be really safe, you can purge the PPA before doing the upgrade.

Comments

comments