Programming Books

Main Menu

  • Home
  • Phyton programming
  • Java programming
  • Php programming
  • C++ programming
  • Additional Topics
    • Programming industry
    • Privacy Policy
    • Terms and Conditions

Programming Books

Header Banner

Programming Books

  • Home
  • Phyton programming
  • Java programming
  • Php programming
  • C++ programming
  • Additional Topics
    • Programming industry
    • Privacy Policy
    • Terms and Conditions
Phyton programming
Home›Phyton programming›How To Install Python 2 On Ubuntu 22.04 LTS Jammy Linux

How To Install Python 2 On Ubuntu 22.04 LTS Jammy Linux

By Brandy J. Richardson
May 7, 2022
0
0

Get the easy steps to install Python2 or 2.7 on Ubuntu 22.04 LTS Jammy JellyFish using the command terminal to run old apps that need this version.

Python is an object-oriented programming language that offers clear syntax and easy readability. it is easy to learn and very versatile. The language was released in 1991 and is similar to PERL. Available for use on UNIX, Linux, Windows and Mac OS.

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.

Python is widely used in science. Another important application area is the research and programming of applications in the field of artificial intelligence (AI) and machine learning. For example, TensorFlow.

Advantages of Python Programming Language

• Easy to understand syntax
• Clear structure and a small number of keywords
• No variable declaration is needed
• Extensive standard library available
• Less prone to errors
• Fewer lines of code compared to many other programming languages
• Support for different programming paradigms
• Add-ons to extend Python’s capabilities and scalability
• Suitable for complex tasks and almost all application problems
• Broad community support

Steps to Install Python 2 on Ubuntu 22.04 LTS Linux

The steps given here can be used for previous Ubuntu versions such as 18.04/20.04, including Debian, Linux Mint, Elementary OS, PO_OS, etc.

1. Perform a system update

It is necessary to perform the system update on Linux if you haven’t done so for a while. This not only installs the latest security updates, but also refreshes the APT package manager cache.

sudo apt update

2. Install Python 2 on Ubuntu 22.04 LTS

Even though Python 3 is the default version of Ubuntu 22.04 LTS, Python 2.7 can be installed using Ubuntu’s default system repository. Here is the command to follow.

sudo apt install python2

3. Check version

After the installation is complete, we can check which version of Python2 is exactly installed on our system.

python2 --version

Check version

4. Set Python2 as default on Ubuntu 22.04

By default, Python 3 will be the system-wide default version, however, if you want to upgrade to Python 2 and set it as the system default, follow the steps below:

Check which versions of Python are available on your systems:

ls /usr/bin/python*

list python versions

To find out whether a version is configured as a python alternative or not. For this race:

sudo update-alternatives --list python

If the output is:

“update-alternatives: error: no alternatives for python”

Then that means no alternatives have been configured, so let’s do some.

Here we set up two versions as alternatives, later we can choose between them to set one as the default system.

sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 2

Upgrade to Python version 2

sudo update-alternatives --config python

Upgrade to Python version 2

This time you will see several options including Python 2. Enter the Selection number of the Python you want to set as the system default. For examplehere the Python2 is at number 1so we type this and Walk in key.

Set python alternative in Ubuntu 22.04

When you check the version of Python this time you will have 2.7.

5. Uninstall or remove

To completely remove Python 2 from Ubuntu 22.04, if it is not needed, the command will be:

First Adjust default version to Python 3 using:

sudo update-alternatives --config python

After that remove version 2 from your system:

sudo apt autoremove python2 --purge

Other Items:

• 3 Ways to Install Ruby on Ubuntu 22.04 LTS…
• How to Install Maven on Ubuntu 22.04 LTS…
• Install VirtualBox on Ubuntu 22.04…
• Install VMware Workstation Player on Ubuntu 22.04…

Related posts:

  1. KN Circet Partners with Donegal ETB for New Network Planner Internship – Donegal Daily
  2. Top Quality Machine Learning Artificial Intelligence Super Pack Available For Huge Discount Offer
  3. Agreements | Harmonia Ancient Music
  4. RegexLearn and other RegEx resources

Archives

  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • January 2021
  • December 2019
  • November 2019
  • October 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2017

Categories

  • C++ programming
  • Java programming
  • Php programming
  • Phyton programming
  • Programming industry

Recent Posts

  • 12-bit dual-channel PCIe card samples at 2x 3.2 Gsample/s
  • Woster: Need work for those stifled by student loans – Mitchell Republic
  • How to Become a Cloud Engineer
  • [Unveil]Emerging indie band SURL wants to bring rock back to the masses
  • Ansible vs. Puppet | Compare DevOps tools
  • Privacy Policy
  • Terms and Conditions