我是靠谱客的博主 热情路灯,这篇文章主要介绍yum 无法使用,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
[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版本

复制代码
1
2
3
4
5
6
[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版本

复制代码
1
2
[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内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(67)

评论列表共有 0 条评论

立即
投稿
返回
顶部