首页 > 其他 > 详细

yum 安装

时间:2019-10-02 11:26:52      阅读:107      评论:0      收藏:0      [点我收藏+]

yum 安装本来是个很简单的事情,只是网上的教程一般不全,每次装每次都踩坑,必须做个笔记了。

 

具体安装过程请自行百度,一堆

推荐 简洁明了

 

下面记录一个问题:明明按教程一步步安装完了,仍然报错

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.

Its possible that the above module doesnt match the
current version of Python, which is:
2.7.12 (default, Oct  1 2019, 01:09:22) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

这个问题是因为 yum 不支持 python2.7,而我的电脑上的 python 版本就是 2.7

 

解决办法

第一步: 查看 python 版本

[root@hadoop10 yum]# whereis python
python: /usr/bin/python2.6 /usr/bin/python /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/share/man/man1/python.1.gz

我 重装了 python,把 2.6 升级到了 2.7

 

第二步:修改 yum 的 python 版本

[root@hadoop10 yum]# which yum
/usr/bin/yum
[root@hadoop10 yum]# vi /usr/bin/yum

#!/usr/bin/python2.6
import sys
try:
    import yum
except ImportError:

把 yum 第一行 python 改成 python2.6

 

yum 安装

原文:https://www.cnblogs.com/yanshw/p/11616891.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!