今天在使用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 就可以使用了