How to Install Python on Ubuntu 20.04

Install Python on Ubuntu 20.04

In this article, we will have explained the necessary steps to install and configure Python on Ubuntu 20.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Python is one of the most popular programming languages in the world. With its simple and easy to learn syntax Python is a great choice for beginners and experienced developers. Python is quite a versatile programming language, you can use it to do almost anything you want, write small scripts, build games, develop websites, and many more.


  • Operating System with CentOS 8
  • Server IPv4 Address with Superuser Privileges (Root Access)
  • Gnome Terminal for Linux Desktop
  • PuTTy SSH client for Windows or macOS
  • Powershell for Windows 10/11
  • Familiar with APT Commands

Install Python on Ubuntu 20.04

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

sudo apt update
sudo apt upgrade
sudo apt install software-properties-common

Step 2. Install Python on Ubuntu system.

  • Installing Python 3.9 on Ubuntu 20.04 LTS

Add the deadsnakes PPA to your system’s sources list:

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9

Verify that the installation:

python3.9 --version
  • Installing Python 3.8 on Ubuntu 20.04 LTS

Now you can start the installation of Python 3.8 with the command:

sudo apt install python3.8

Python 3.8 has been installed and ready to be used. Verify it by typing:

python3.8 --version
  • Installing Python 2 on Ubuntu 20.04 LTS

To install Python 2 version on Ubuntu 20.04 open a terminal and enter one of the following commands:

sudo apt install python2

Confirm the installation and check the version of Python by entering the following command:

python2 -V

That’s all you need to do to install Python on Ubuntu 20.04 LTS Focal Fossa. I hope you find this quick tip helpful. For further reading on Python, please refer to their official knowledge base. If you have questions or suggestions, feel free to leave a comment below.