Linux Mint

How to Install Latest Python on Linux Mint 21

Python is a user-friendly high-level and object-oriented programming language that can be easily interpreted. This general-purpose language is famous among users for simple coding projects to complex scripts including Artificial Intelligence and machine learning scripts. It has easily understandable syntax for coding even for the beginners.

Although it is easy to understand, it can perform complex algorithms and can handle huge amounts of data. Python language was designed in a way that it can be extended by adding more modules to the existing ones.

How to Install Latest Python on Linux Mint 21

The latest version of Python can be installed via an external PPA repository. For this, few steps should be followed carefully:

Open the terminal and update apt packages using command:

$ sudo apt update

 

Execute the mentioned command to install prerequisite dependencies of Python:

$ sudo apt install software-properties-common

 

Next step it to add PPA repository to the Linux Mint base repository (as it is external repository, so we need to add it first):

$ sudo add-apt-repository ppa:deadsnakes/ppa

 

As all the dependencies and external repository are installed on Linux Mint 21. Now we can download Python on system by running the following command:

$ sudo apt install python 3.9

 

Use the version command to verify if python is installed or not:

$ sudo python 3.9 --version

 

How to Uninstall Python from Linux Mint 21

To remove Python from Linux Mint 21 system, the following would be use:

$ sudo apt-get purge --autoremove python3.9

 

As we have added a PPA repository to the system before downloading Python. So, you can also remove it from system:

$ sudo add-apt-repository --remove ppa:deadsnakes/ppa

 

Conclusion

This article has focused on how to install an updated version of Python on Linux Mint 21. Python is a highly recommended interpreted language used for various purposes. It can create small projects to large scripts like machine learning and AI with understandable syntax. It was designed in a way that it can be extended by adding more modules to the existing ones.

About the author

Syeda Wardah Batool

I am a Software Engineer Graduate and Self Motivated Linux writer. I also love to read latest Linux books. Moreover, in my free time, i love to read books on Personal development.