码迷,mamicode.com
首页 > 其他好文 > 详细

yum安装报错

时间:2018-08-01 14:16:13      阅读:396      评论:0      收藏:0      [点我收藏+]

标签:package   sys.argv   possible   name   ofo   meta   pos   term   cti   

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, 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:
%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, "\n\nExiting 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]# 

yum安装报错

标签:package   sys.argv   possible   name   ofo   meta   pos   term   cti   

原文地址:http://blog.51cto.com/357712148/2153073

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!