Serverspace Black Friday
October 3, 2022
Updated October 3, 2022

Install Python (latest version) on Ubuntu 20.04

Linux Ubuntu

What is a Python

Python is one of the most used programming language. The main advantages is relative simplicity, low learning curve, in-use versality, much third-parties designed plugins. Now this programming langage is popular for script-making, software producing, game development and even neuro-network learning. Python has cross-platform syntax and may be setup onto any actual operation system.

Method to get the newest Python

If recently developed Python is absolutely needed, you can face in-front of problem. The reason is update delay, Ubuntu repositories are not always contains the updated software versions. So, to get the most modern Python vervion please do:

  • Login into the operation system as superuser;
  • Setup all requred tools;
apt install -y software-properties-common
  • Update other exist packages;
apt-get update -y; apt upgrade -y


  • Reboot the server;
  • Include additional repository to the system pool of sources;
add-apt-repository -y ppa:deadsnakes/ppa


  • Renew the cache, then find which Python version is actual now;
apt-get update && apt-cache search python3.1


  • As we see, the hottest version is 3.11 today. So, time to get it. Just run apt manager:
apt-get install python3.11 -y


  • Next step is optional. Create symlynk for convenient using, then check the interpreter is really working:
ln -s /usr/bin/python3.11 /usr/bin/python
python --version


Building from source code

If setup via pre-built package is impossible, you also have the way to build "fresh" Python from the codes. It's so simple, just do this:

  • Login to the operation system as superuser and update system packages as discribed earlier;
  • Install building inventory;
apt-get -y update; apt -y install zlib1g-dev build-essential libgdbm-dev libncurses5-dev libssl-dev libnss3-dev libffi-dev libreadline-dev wget libsqlite3-dev libbz2-dev



  • Pull the archive to any server folder and unpack it;
mkdir /root/build
cd /root/build
wget <copied_URL>
tar -xf *.tgz


  • Switch into the folder with code files, then prepare OS to the building process;
cd <python_version>

./configure --enable-optimizations


  • Begin the building procedure and take a cup of coffee, it will take a time depends of processor power server has:
make -j $(nproc)


  • Final step is "including" package you've made to the OS:
make altinstall


  • Now ask the Python about its version, you should see picture like below.
ln -s /usr/local/bin/python3.11 /usr/bin/python
python --version


Your work is finished, well done!

In a nutshell

Now you knew about Python, its advantages and scopes of using. Also you could install it from repository or via self-building.

5 out of 5
Аverage rating : 5
Rated by: 2
1101 CT Amsterdam The Netherlands, Herikerbergweg 292
+31 20 262-58-98
700 300
700 300
We use cookies to make your experience on the Serverspace better. By continuing to browse our website, you agree to our
Use of Cookies and Privacy Policy.