How to Install Python 3.9 on Ubuntu (Latest Version)
In this article, we will learn how to install Python 3 on an Ubuntu system.
The latest version of Python is 3.9 and is not available to install VIA standard Ubuntu 20.04 repositories. We will therefore need to use a PPA (personal package archive) created by deadsnakes to do this.
With Apt
The apt
package manager is the easiest way to install Python 3.9 on Ubuntu, though as previously mentioned, we will need to use a PPA.
Firstly, update apt
then install software-properties-common
, which will allow the system to add and remove PPA's.
sudo apt update
sudo apt install software-properties-common
Then add the deadsnakes PPA using the following command:
sudo add-apt-repository ppa:deadsnakes/ppa
Now install Python 3.9 using the following command:
sudo apt install python3.9
When prompted press y
and ENTER
to continue the installation process.
That's it! You can verify Python 3.9 is on your system by using this command:
python3.9 -V
Python 3.9.1
Conclusion
You have successfully installed Python 3.9 on your system. To start using it as the default Python option please read my article on how to change the default Python version.