How to Install Python3 in Ubuntu 22.04

Step 1

Open Terminal with shortcut Ctrl+Alt+T

Step 2

update the package manager with below command

sudo apt-get update

Step 3

Install the build-essential package

sudo apt-get install build-essential

Step 4

install the OpenSSL package

sudo apt-get install libssl-dev

Step 5

Now download the latest stable release of Python

Step 6

Navigate to the directory where you downloaded the Python tarball

cd Downloads

Step 7

Extract the tarball you have downloaded in step 6

tar -xf python-3.x.y.tar.xz

Step 8

Now go to the python folder and run the below command

./configure

Step 9

Next build and install python with below commands

make         

sudo make install

Step 10

To check the python version, run the command below

python3 -v