Update Python 2.7 to Latest Version on Ubuntu 14.04

14.04package-managementpythonrepository

The version of python2 on my Ubuntu 14.04 machine is Python 2.7.6. How can I upgrade it to the the latest version of Python 2.X? The latest is currently 2.7.11.

I have tried apt-get update/upgrade, but the repository doesn't seem to have the latest version.

Best Answer

Ubuntu 18.04 and newer:

The new version of Ubuntu no longer uses python 2, so you need to install it with:

sudo apt install python-minimal

Ubuntu 17.04 and older:

The answer appears to be to add a third party repository:

sudo add-apt-repository ppa:jonathonf/python-2.7
sudo apt-get update
sudo apt-get install python2.7
python --version