redhat 5.6 升级python 2.4.3到2.7.15具体操作如下:[root@localhost ~]# python -V
Python 2.4.3[root@localhost ~]# cd /tmp下载Python
wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
[root@localhost ~]# wget https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
--2018-06-05 10:32:49--  https://www.python.org/ftp/python/2.7.15/Python-2.7.15.tgz
正在解析主机 www.python.org... 151.101.228.223, 2a04:4e42:36::223
Connecting to www.python.org|151.101.228.223|:443... 已连接。
OpenSSL: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
无法建立 SSL 连接。本人测试用的redhat 5.6 wget 无法下载Python-2.7.15.tgz,故用Windows下载后上传到/tmp解压
[root@localhost tmp]# tar -zxvf Python-2.7.15.tgz编译安装
[root@localhost tmp]# cd Python-2.7.15
[root@localhost Python-2.7.15]# mkdir /usr/local/python27
[root@localhost Python-2.7.15]# ./configure --prefix=/usr/local/python27
[root@localhost Python-2.7.15]# make
[root@localhost Python-2.7.15]# make install#备份python旧版本信息
[root@localhost tmp]# mv /usr/bin/python /usr/bin/python2.4.3_old#删除旧链接并重新创建链接
[root@localhost tmp]# rm /usr/bin/python2
rm:是否删除 符号链接 “/usr/bin/python2”? y
[root@localhost tmp]# ln -s /usr/bin/pythonpython2.4.3_old /usr/bin/python2#重新建立Python2.7的环境变量
[root@localhost tmp]# ln -s /usr/local/python27/bin/python2.7  /usr/bin/python查询Python版本信息
[root@localhost tmp]# python -V
Python 2.7.15