1- Run the following commands as root or user with sudo access to update the packages list and install the prerequisites:
2
3sudo apt update
4sudo apt install software-properties-common
5
6- Add the deadsnakes PPA to your system’s sources list:
7
8sudo add-apt-repository ppa:deadsnakes/ppa
9When prompted press Enter to continue:
10
11- Press [ENTER] to continue or Ctrl-c to cancel adding it.
12- Once the repository is enabled, install Python 3.8 with:
13
14sudo apt install python3.8
15
16- Verify that the installation was successful by typing:
17
18python3.8 --version