Hi, folks. In this post, I will show you how to install Python 3.9 on Ubuntu 20.04 / 18.08
Python is one of the most popular programming languages out there. Its incredible versatility makes it be in almost any technology field. In addition, its learning curve is quite low which makes it ideal for learning.
In the case of Ubuntu 20.04 we have Python 3.8 but in Ubuntu 18.04 an very older version.
The truth is that Ubuntu 18.04 is in its best moment of stability, but also some of its packages are starting to get old. That’s why some people update some of them individually. Especially the most important ones for work.
Install Python 3.9 on Ubuntu 20.04 / 18.04
There are several methods and ways to install Python 3.9 on Ubuntu 20.04 / 18.04 however in this post, we will show you the easiest and most recommended ones too.
We will achieve this by adding a PPA that already has Python 3.9 ready for us. With this method you will not have to build the package by yourself, saving time, and even improving the results.
Therefore, this is the best possible method.
So, open a terminal or connect to your server via SSH
Then, install some necessary packages:
sudo apt install wget software-properties-common
Then you can add the repository in question:
sudo add-apt-repository ppa:deadsnakes/ppa
Then refresh the APT cache
sudo apt update
And finally, install Python 3.9 in Ubuntu 20.04 / 18.04
sudo apt install python3.9 Reading package lists… Done Building dependency tree Reading state information… Done The following packages were automatically installed and are no longer required: linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic linux-image-5.4.0-26-generic linux-modules-5.4.0-26-generic linux-modules-extra-5.4.0-26-generic Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: libpython3.9-minimal libpython3.9-stdlib python3.9-minimal Suggested packages: python3.9-venv python3.9-doc binutils 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 55 not upgraded. Need to get 4952 kB of archives. After this operation, 19.8 MB of additional disk space will be used. Do you want to continue? [Y/n]
Check the results, showing the version we just installed:
So, enjoy it.
Python is a very popular programming language and this makes it appealing to many users. Also, keeping the latest stable version installed is relatively easy so we gain stability and features.