This question already has an answer here:

I am stuck on Ubuntu 14.04 and upgrading to 15.10 is probably not an option. The highest version of python supported by Ubuntu 14 is 2.7.6.
This is very old. I want to install a newer version.

I understand that all I need is a .deb version of the software that I'd like to install. I think I just need to find a server that has this and added it to the list of repositories (/etc/apt/sources.list) and then apt-get will magically do the right thing.

However, I am going to want to break the rules and install newer versions of other software too. The more often I do this, the more likely bad things are to happen of course. However, I suspect that there are MANY people in my shoes who want to do the same thing. So maybe there is repository for rule breakers like myself can use to replace the official Ubuntu repositories?

Does such a magical repository exist?

If I add it to /etc/apt/sources.list, will apt-get install python give me a newer version of python than is available via the official repositories?

marked as duplicate by karel, Eliah Kagan, Zanna, Eric Carvalho, Videonauth Nov 19 '17 at 1:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Suppose there exists such a magical repository. What software should it contain? – muru Feb 10 '16 at 15:54

Using the newest python version

It is not recommended to change the python version of your system (i.e. with apt-get update python), since many scripts rely on a specific version. You can brake your system and it may cause problems with future updates. Instead, you may want to have a look at virtual environments as answered here.

Using python 3

According to the Ubuntu 14.04.5 manifesto, python 3.4 is now included with trusty by default. You can use it with the command: python3 <path-to-some-optional-script>.

Replace the official repositories / Maintain packages

There is no such thing as the mentioned magical repository. However, there are Personal Package Archives instead, providing newer package version (also triggered by a apt-get update) and are maintained by the community. There is a question covering this topic on SE here.

You can also download .deb files with a newer version and use the tool gdebi to install them. However, you will need to take care of newer versions when using local .deb-files.

  • 1
    @Zanna thanks, well spotted. According to manifest, it seems to be the case since 14.04.3. I'll update my answer. – Marcus Nov 18 '17 at 14:02
apt-get install python3

this should do it. remember python3 takes input as string and used function to parse it to another format.

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