Install Python 2 on Ubuntu 22.04 Jammy Jellyfish Linux

This tutorial will show how to install Python 2 for Ubuntu 22.04 Jammy Jellyfish. Python 2 has not been the default installed version on Ubuntu versions for a few years, but it’s still possible to install Python 2 and to install Python 2.7 on Ubuntu 22.04.

Follow the step by step instructions below to see how to install Python 2 and use it as the default Python interpreter on Ubuntu 22.04 Jammy Jellyfish.

In this tutorial you will learn:

  • How to install Python 2 Ubuntu 22.04
  • How to switch Python 2 as a default python interpreter
Install Python 2 on Ubuntu 22.04 Jammy Jellyfish Linux
Install Python 2 on Ubuntu 22.04 Jammy Jellyfish Linux
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 22.04 Jammy Jellyfish
Software Python 2
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Install Python 2 on Ubuntu 22.04 step by step instructions



  1. To install Python 2 version on Ubuntu 22.04 open a command line terminal and enter the following commands:
    $ sudo apt update
    $ sudo apt install python2
    
  2. Check your current Python version:
    $ python2 -V
    Python 2.7.17
    
  3. Follow our tutorial on how to switch to Python 2 from Python 3 as a default version on Ubuntu 22.04. You may also be interested to install Python package manager on your Ubuntu 22.04 system.

Closing Thoughts

In this guide, we saw how to install Python 2 on Ubuntu 22.04. In particular, you saw how to install Python 2.7 on Ubuntu 22.04, which is the last release of Python 2, from April 2020. Although this version is now deprecated, it can still be installed and used for legacy purposes on Ubuntu and other Linux systems.