二.下载python3.6.9
https://www.python.org/ftp/python/3.6.9/
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar zxvf Python-3.6.9.tgz
cd Python-3.6.9
./configure
make && make install
三.配置
cp /usr/local/bin/python3 /usr/bin/python3
rm -f /usr/bin/python
rm -f /usr/bin/python2
ln -s /usr/bin/python3 /usr/bin/python
ln -s /usr/bin/python3 /usr/bin/python2
python -V 检查版本
四.修改yum配置,保证yum能用
修改usr/libexec/urlgrabber-ext-down和/usr/bin/yum两个文件
将 #!/usr/bin/python 改为 #!/usr/bin/python2.7后保存退出即可
因为python3和yum的版本不兼容,所以要改成2.7,要不然需要升级yum
原文:https://blog.51cto.com/anfishr/2438909