Python is a very powerful high-level programming language that has seen extensive adoption in modern applications development. Python programs are remarkably easy to write when compared to other programming languages. There are lots of resources that can help you start your Python programming journey. In this article you’ll learn to install Python 3.9 on Ubuntu and Linux Mint system.
Install Python 3.9 on Ubuntu 20.04 | Linux Mint 20
As of this article writing the latest release version of Python is 3.9. The latest packages of Python are not usually available on the OS upstream repositories. We will be installing Python 3.9 on Ubuntu | Linux Mint by building the application from source code.
The first step will be to update the system and upgrade all system packages.
sudo apt update sudo apt -y upgrade
Once the upgrade is done reboot the system to boot to the newest kernel that might have been installed during upgrade.
Also install some dependencies on the system.
sudo apt install wget build-essential software-properties-common -y
Add Python PPA repository
The latest packages of Python for Ubuntu and its derivatives such as Linux Mint are available in deadsnakes PPA repository.
Let’s add the repository to our system by running the following commands:
sudo add-apt-repository ppa:deadsnakes/ppa
Just hit the enter key to agree to repository addition.
.... Sources ======= The package sources are available at: https://github.com/deadsnakes/ Nightly Builds ============== For nightly builds, see ppa:deadsnakes/nightly https://launchpad.net/~deadsnakes/+archive/ubuntu/nightly More info: https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa Press [ENTER] to continue or Ctrl-c to cancel adding it. Hit:1 http://security.ubuntu.com/ubuntu focal-security InRelease Get:2 http://mirrors.digitalocean.com/ubuntu focal InRelease [265 kB] Get:3 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease [18.1 kB] Hit:4 http://mirrors.digitalocean.com/ubuntu focal-updates InRelease Hit:5 http://mirrors.digitalocean.com/ubuntu focal-backports InRelease Get:6 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main amd64 Packages [17.7 kB] Get:7 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal/main Translation-en [4368 B] Fetched 305 kB in 1s (381 kB/s) Reading package lists... Done
Install Python 3.9 on Ubuntu | Linux Mint
Once the repository is added start installation of Python 3.9 on Ubuntu | Linux Mint.
sudo apt update sudo apt install python3.9
Accept installation prompt using the y key in your keyboard.
.... Suggested packages: python3.9-venv python3.9-doc binfmt-support The following NEW packages will be installed: libpython3.9-minimal libpython3.9-stdlib python3.9 python3.9-minimal 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 4819 kB of archives. After this operation, 19.2 MB of additional disk space will be used. Do you want to continue? [Y/n] y
Confirm Python version.
$ python3.9 -V Python 3.9.1
We’ve finally installed Python 3.9 on Ubuntu and Linux Mint from a PPA APT repository.