yum安装报错

前端之家收集整理的这篇文章主要介绍了yum安装报错前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

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

  1. yum install tcl y
  2. There was a problem importing one of the Python modules
  3. required to run yum. The error leading to this problem was:
  4.  
  5. No module named yum
  6.  
  7. Please install a package which provides this module,or
  8. verify that the module is installed correctly.
  9.  
  10. It's possible that the above module doesn't match the
  11. current version of Python,which is:
  12. 2.7.8 (default,Jan 3 2018,20:47:59)
  13. [GCC 4.4.7 20120313 (Red Hat 4.4.7-18)]
  14.  
  15. If you cannot solve this problem yourself,please go to
  16. the yum faq at:
  17. http://yum.baseurl.org/wiki/Faq
  18.  
  19. [root@bogon redis-3.0.2]#
  20. [root@bogon redis-3.0.2]# which yum/usr/bin/yum
  21. /usr/bin/which: no yum in (./yum/usr/bin)
  22. [root@bogon redis-3.0.2]#
  23. [root@bogon redis-3.0.2]#
  24. [root@bogon redis-3.0.2]# vi /usr/bin/yum

修复方法

  1. #!/usr/bin/python2.6
  2. import sys
  3. try:
  4. import yum
  5. except ImportError:
  6. print >> sys.stderr,"""\
  7. There was a problem importing one of the Python modules
  8. required to run yum. The error leading to this problem was:
  9.  
  10. %s
  11.  
  12. Please install a package which provides this module,which is:
  13. %s
  14.  
  15. If you cannot solve this problem yourself,please go to
  16. the yum faq at:
  17. http://yum.baseurl.org/wiki/Faq
  18.  
  19. """ % (sys.exc_value,sys.version)
  20. sys.exit(1)
  21.  
  22. sys.path.insert(0,'/usr/share/yum-cli')
  23. try:
  24. import yummain
  25. yummain.user_main(sys.argv[1:],exit_code=True)
  26. except KeyboardInterrupt,e:
  27. print >> sys.stderr,"\n\nExiting on

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

再次安装成功:

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

猜你在找的Bash相关文章