22

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.

  • 2
    I'm voting to reopen this question because the answer to the linked question is obsolete while this one is up to date (as far as I can tell). They should either be merged or the duplicate relationship should be reversed. – David Foerster Nov 17 '17 at 11:37
  • @DavidFoerster Done. We can vote to close that question as a duplicate of this one now, which I've done. – Eliah Kagan Nov 17 '17 at 14:45
  • 1
    @dbliss This is normal practice on stackexhange. – Morgoth Nov 17 '17 at 16:07
  • 1
    I've removed some of my comments so any future comments will more likely be seen, and to reduce distraction from the actual Q&A here. Anyone interested may read them, in context and with continued discussion, in this chat room (transcript). I reiterate, however, that any serious concerns are better discussed--and far more likely to be resolved--on Ask Ubuntu Meta than in comments or chat. – Eliah Kagan Nov 17 '17 at 18:01
28

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
  • Error: 'fkrull/deadsnakes-python2.7' invalid – Igor Pomaranskiy Mar 27 '16 at 9:39
  • 2
    Thanks. But it works till python 2.7.12, now the latest release is 2.7.13. – zhihong Feb 24 '17 at 14:55
  • 1
    It appears this PPA has now been taken offline, launchpad.net/~fkrull/+archive/ubuntu/deadsnakes-python2.7 403 – giorgiosironi Aug 2 '17 at 15:59
  • 1
    @Gaia, Try sudo apt install python-minimal, it looks like the new way to do it. I has a newer version of python 2.7 than ppa:jonathonf/python-2.7 too. – Morgoth Jul 29 '18 at 11:41
  • 3
    I am using Ubuntu 14.04. Just did as the answer says for my version (17.04 and older) and I just got Python 2.7.14 which is newest version of python 2 today (15.8.2018.). Thanks! :) – Filip Savic Aug 15 '18 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.