Install Python 3.8.2 on Ubuntu 18.04 / RHEL & CentOS 8

Python one of the most commonly used programming languages in the world. It is developed under an approved OSI -approved open source license making it freely usable and distributable.

Python team released a new version of 3.8.2 for general use.

This tutorial will be to help you to install Python 3.8.2 on Ubuntu 18.04 LTS / 19.10, LinuxMint, CentOS 8, RHEL 8 and Fedora 31.

Step 1: Install dependencies

For RHEL / CentOS / Fedora distributions install the below packages

dnf install gcc openssl-devel bzip2-devel libffi-devel

For Ubuntu / LinuxMint distributions install the below packages

sudo apt-get install build-essential checkinstall libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev

Step 2: Download Python 3.8.2

Download python 3.8.2 from the official site or use the below command to download

cd /var/tmp && wget

Step 3: Extract the package

tar -xf Python-3.8.2.tgz

Step 4: Compile Python from source

cd Python-3.8.2 && sudo ./configure –enable-optimizations

sudo make altinstall

altinstall is used to prevent replacing the default python binary file.

If you got the below message during compiling the package then it is success

python compile message

Step 5: Verify the version

Verify the package by using the below command and remove the downloaded file if not required

python3.8 -V

python 3.8.2 output

Leave a Reply

Secured By miniOrange