10.7 C
New York
Saturday, January 28, 2023

Install Python 3.9 or 3.8 on Ubuntu 22.04 LTS Jammy JellyFish – Linux Shout

Learn how to use the PPA repository to install Python’s old versions such as 3.9. 3.8, 3.7, and more on Ubuntu 22.04 Jammy JellyFish using the command terminal. 
Python is freely available for the common operating systems. The programming language is standard equipment in many Linux distributions. Python can also be used on many mobile operating systems. For web servers, WSGI (Web Server Gateway Interface) is a universal interface between the server and Python.
It offers clear syntax and good readability. It is considered easy to learn and can be interpreted in the common operating systems. Python supports several programming paradigms such as functional, object-oriented, or aspect-oriented programming and can also be used as a scripting language.
Since Python is a so-called multiparadigm language, programmers are not tied to a specific programming style. The optimal programming style can be selected for the various tasks. Python allows Python programs to be embedded in other languages ​​as individual modules.
There are many scenarios when we especially the developers need to have an old python version to work with some particular application or on the project. In this tutorial, we learn how to get that…
Execute the system update command to ensure our Ubuntu 22.04 has the latest security and package versions. Open your terminal and run:
The old versions of Python such as 3.9, 3.8, 3.7, and older are not available to install using the default system repository of Ubuntu 22.04 LTS Jammy JellyFish or 20.04 Focal Fossa. Hence, we need to add a PPA offered by the “deadsnakes” team to get the old archived Python versions easily.
Once you have added the PPA repository, we can install most of the old python versions with just one command. To confirm the version you want is available to install or not, you can run:
Add PPA for Python old versions
Well, once you have confirmed the version you want of Python is available to install using the added repository, next use the given command syntax to install it.
For example, you want to install version 3.9
Install python3.9 on Ubuntu 22.04
The way we have installed version 3.9 using the PPA, we can go for the 3.8 as well.
Install Python 3.8 on Ubuntu 22.04 Jammy
In the same way, we can install Python other versions such as 3.7, 3.6, and more…
If you have installed multiple versions of Python and want to set any of them as the default version of the system then that can be possible as well. For example, you have the latest version of Python 3.10 (was while doing this article) and also have installed python 3.9 and 3.8; now to set any of them are system’s default use Update-alternatives command:
Check what python versions are available on your systems:
Check what python versions are available on Ubuntu
To know whether any version is configured as python alternatives or not. For that run:
If the output is:
“update-alternatives: error: no alternatives for python”
Then it means there are no alternatives that have been configured, hence let’s do some.
Here we are setting up two versions as alternatives, later we will be able to choose between them to set one of them as the system default one.
Switch the default Python version 
This time you will see several options including Python 3.9 and 3.8. Enter the Selection number of the Python you want to set as the system’s default one. For example, here Python3.9 is at number 3, hence we type that and Enter key.
sudo update alternatives config python
When you check the version of Python this time, you will have 3.9. For that use:
Those who don’t want to the installed python version on the system and also want to remove the PPA if doesn’t require any more, use the given commands.
In the same way for 3.8:
To remove PPA:
Other Articles:
5 Redhat enterprise-based alternatives for CentOS 8
Install Python 3.x or 2.7 on Debian 11 Bullseye Linux
6 Best Ubuntu Linux Alternatives for Beginners to use in 2022
Ubuntu 22.10 Kinetic Kudu – Daily Build ISO Download



This site uses Akismet to reduce spam. Learn how your comment data is processed.
Linux Shout crafted as a part of our main portal H2S Media to publish Linux related tutorials and open source Software.


Related Articles


Please enter your comment!
Please enter your name here

Latest Articles