#升级版本
Yum-y install Gcccd/optwget Http://python.org/ftp/python/2.7.6/Python-2.7.6.tgztar XF python-2.7.6.tgz./configure-- prefix=/usr/local/python2.7 CD python-2.7.6./configure--prefix=/usr/local/python2.7 make && make INSTALLMV/ Usr/bin/python/usr/bin/python.bakln-s/usr/local/python2.7/bin/python2.7/usr/bin/python
#解决Python升级yum无法使用的办法
[[email protected] yum.repos.d]# yum repolistthere was a problem importing one of the python modulesrequired to run yum. the error leading to this problem was: no module named yumplease install a package which provides this module, orverify that the module is installed correctly. It ' S POSSIBLE THAT THE ABOVE MODULE DOESN ' t match thecurrent version of python, which is:2.7.6 (default, jul 7 2016, 15:02:52) [GCC 4.4.7 20120313 (RED HAT 4.4.7-17)]if you cannot Solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/faq
#查看Python版本
[Email protected] init.d]# Whereis Pythonpython:/usr/bin/python2.6-config/usr/bin/python.bak/usr/bin/python/usr/ bin/python2.6/usr/lib/python2.6/usr/lib64/python2.6/usr/include/python2.6/usr/local/python2.7/usr/share/man/ Man1/python.1.gz
#配置yum使用回低版本的python
[Email protected] init.d]# head-1/usr/bin/yum #!/usr/bin/python2.6
#yum正常了
[[Email protected] init.d]# yum repolistloaded plugins: fastestmirrorloading mirror speeds from cached hostfilerepo id repo name statusbase CentOS-6 - Base - 163.com 6,696extras centos-6 - Extras - 163.com 62updates CentOS-6 - Updates - 163.com 139repolist: 6,897
Because Yum is written in Python and the Python version is upgraded, Yum calls the higher version of Python, so the error
This article is from the "Wsyht blog" blog, make sure to keep this source http://wsyht2015.blog.51cto.com/9014030/1825841
The workaround that Yum cannot use after upgrading the Python version and version upgrade