vim /usr/bin/yum 改:#! /usr/bin/python 为:#! /usr/bin/python2
更改配置文件
vim /usr/libexec/urlgrabber-ext-down 改:#! /usr/bin/python 为:#! /usr/bin/python2
验证版本号
[root@localhost ~]# python -V Python 3.6.8
使用python2版本
[root@localhost ~]# python2 Python 2.7.5 (default, Oct 30 2018, 23:45:53) [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>>
使用python3版本
python Python 3.6.8 (default, Nov 17 2021, 16:00:46) [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux Type "help", "copyright", "credits" or "license" for more information. >>>