How-To: Install Python on Ubuntu 22.04

Classroom and Python
BG Source: Python logo source:

Python by default is available on Ubuntu. But if by some chance it’s not, here are some steps on how to install it.

Check if Installed

To verify if Python is installed you can check where it is installed

$ whereis python
$ whereis python3

Or run the python and check if you can access the python shell

$ python3

Exit the python shell by executing exit().

Install via package manager

If Python 3 is not installed, follow the steps below.

01. Update the package manager repositories

$ sudo apt-get update

02. Install Python

$ sudo apt-get install python3 -y

03. Verify that Python has been installed

$ python3

04. Enter exit to remove from the Python interpreter. 

>>> exit()

Uninstall via package manager

Warning! It is not ideal to remove Python as some Python is installed by default for a reason. But if you are sure or just testing things out, go ahead and follow the steps below.

01. Remove Python

$ sudo apt remove python3

02. Run the autoremove command to remove Python. If this is not run, Python will still be available.

$ sudo apt autoremove

For enquiries, product placements, sponsorships, and collaborations, connect with us at We'd love to hear from you!