加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

yum安装报错

发布时间:2020-12-15 19:07:50 所属栏目:安全 来源:网络整理
导读:http://yum.baseurl.org/wiki/Faq yum install tcl –yThere 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,or

http://yum.baseurl.org/wiki/Faq

yum install tcl –y
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.8 (default,Jan  3 2018,20:47:59) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]

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

[root@bogon redis-3.0.2]# 
[root@bogon redis-3.0.2]# which yum/usr/bin/yum
/usr/bin/which: no yum in (./yum/usr/bin)
[root@bogon redis-3.0.2]# 
[root@bogon redis-3.0.2]# 
[root@bogon redis-3.0.2]# vi /usr/bin/yum

修复方法:

#!/usr/bin/python2.6   
import sys
try:
    import yum
except ImportError:
    print >> sys.stderr,"""
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   %s

Please install a package which provides this module,which is:
%s

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

""" % (sys.exc_value,sys.version)
    sys.exit(1)

sys.path.insert(0,'/usr/share/yum-cli')
try:
    import yummain
    yummain.user_main(sys.argv[1:],exit_code=True)
except KeyboardInterrupt,e:
    print >> sys.stderr,"nnExiting on

修改成功后:
修改 :#!/usr/bin/python2.6 具体python路径

再次安装成功:

[root@bogon redis-3.0.2]# yum install tcl –y   
Loaded plugins: fastestmirror,refresh-packagekit,security
Determining fastest mirrors
epel/metalink                                                                                                                                       | 7.8 kB     00:00     
 * base: mirrors.aliyun.com
 * epel: mirrors.aliyun.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
base                                                                                                                                                | 3.7 kB     00:00     
base/primary_db                                                                                                                                     | 3.7 MB     00:13     
epel                                                                                                                                                | 3.2 kB     00:00     
epel/primary                                                                                                                                        | 2.9 MB     00:08     
epel                                                                                                                                                           10197/10197
extras                                                                                                                                              | 3.3 kB     00:00     
https://repos.influxdata.com/rhel/6/i386/stable/repodata/repomd.xml: [Errno 14] problem making ssl connection
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: influxdb. Please verify its path and try again
[root@bogon redis-3.0.2]#

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读