概述
[root@zabbix yum.repos.d]# yum update There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python, which is: 2.7.2 (default, Apr 11 2016, 10:35:40) [GCC 4.4.7 20120313 (Red Hat 4.4.7-16)] If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq
YUM 是基于python 写的,错误是由于yum 调用了高版本的PYTHON
查看yum版本
[root@zabbix yum.repos.d]# rpm -qa |grep yum yum-3.2.29-69.el6.centos.noarch yum-metadata-parser-1.1.2-16.el6.x86_64 yum-3.2.29-40.el6.centos.noarch yum-plugin-fastestmirror-1.1.30-30.el6.noarch yum-plugin-fastestmirror-1.1.30-14.el6.noarch
查看python版本
[root@zabbix yum.repos.d]# whereis python
python: /usr/bin/python /usr/bin/python2.6 /usr/bin/python2.6-config /usr/bin/python2.7 /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz
有2.6与2.7两个版本
#which yum
/usr/bin/yum
#vim /usr/bin/yum
#!/usr/bin/python2.6
保存关闭
#yum update
此时可以正常使用
转载于:https://www.cnblogs.com/xfbc/p/5416776.html
最后
以上就是热情路灯为你收集整理的yum 无法使用的全部内容,希望文章能够帮你解决yum 无法使用所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复