使用yum報錯:yum except KeyboardInterrupt, e


今天在使用yum的時候報錯:

[root@localhost /]# yum File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax

原來是自己前幾天安裝了Python 3.5

根據提示,解決方法:

[root@localhost /]# vim /usr/bin/yum #!/usr/bin/python import sys try: import yum except ImportError: print >> sys.stderr, """\

將上面語句改成系統之前默認python2.6的版本:

#!/usr/bin/python2.6 import sys try: import yum except ImportError: print >> sys.stderr, """\

yum 就可以使用了

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM