Install Python 3.8 on Centos/Oracle Linux 6,7

Replace python 2.7 default installed on Centos/Oracle Linux 6,7 by python 3.8

Posted by vmt1991 on 16 Apr 2020
Linux-Unix

1/Set up wget by http/https proxy:

Add below lines to /etc/wgetrc::

http_proxy = http://IP Proxy>:<Port>

https_proxy = http://<IP Proxy>:<Port>

 

2/Export http_proxy and https_proxy env:

export http_proxy=http://IP Proxy>:<Port>

export https_proxy=http://IP Proxy>:<Port>

 

3/Download source and install python 3.8.2:

        wget https://www.python.org/ftp/python/3.8.2/Python-3.8.2.tgz

                tar -xzvf Python-3.8.2.tgz   

               cd Python-3.8.2

               ./configure --enable-optimizations make altinstall

-Relink python in /usr/bin/python

             cd /usr/bin/

             ln -sf /usr/local/bin/python3.8 python

-Recheck version after re-link python:

           python -V