How to Install Python 3.6.8 on Ubuntu 16.04 LTS via PPA - Today I'm gonna show you an easy way to install Python 3.6.8 on Ubuntu 16.04 LTS Xenial Xerus and its derivatives system e.g Linux Mint, Elementary OS, PopOS!, via PPA repository.

Python is an interpreted, object-oriented, high-level, popular programming language with dynamic semantics created by Guido van Rossum and released in 1991.

Suggested read :

Its language constructs and object-oriented approach aim to help programmers write clear, logical code for small and large-scale projects.

Installing Python 3.6 in Ubuntu

Python can be installed on Ubuntu via multiple methods. This post shows you how to install it via Jonathon F's PPA repository. Please note, if you are using Python 3.5, simply don't remove it from your system or it will break.

Change Python Version on Ubuntu 16.04 LTS

First (as usual), open Terminal by pressing Ctrl+Alt+T and run :

sudo add-apt-repository ppa:jonathonf/python-3.6

Enter your password and press Enter to continue. Once it added, run the the following commands :

sudo apt update
sudo apt install python3.6

It will install Python 3.6.8 in your Ubuntu 16.04 LTS Xenial.

Make Python3 to Use Python 3.6

To make python3 use the python 3.6 instead of the default one (Ubuntu 16.04 LTS comes with Python 2.7 and Python 3.5), run the commands below :

sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 2

You can now switch between the two python versions by running :

sudo update-alternatives --config python3

Select your preferred one. That's it!.