1:#升级前的准备工作,安装wget和3.6的tar包
yum -y install wget
mkdir /usr/local/python3
cd /usr/local/python3
wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tgz
tar xvf Python-3.6.3.tgz
cd Python-3.6.3
./configure --prefix=/usr/local/python3
make && make install
2:#备份python2.7 版本
cd /usr/bin
ll python*
mv python python.bak
3:#安装python3
cd /usr/bin
ln -s /usr/local/python3/bin/python3 /usr/bin/python
vim /usr/bin/yum
修改#!/usr/bin/python 为/usr/bin/python2.7
vim /usr/libexec/urlgrabber-ext-down
修改#!/usr/bin/python 为/usr/bin/python2.7
测试yum 成功
网友评论