问题:
[root@muban ~]# yum
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
原因:
yum包源是用python2.x写的,当python2.x升级到python3.x,导致python版本语法的兼容性出现问题
解决方法:
1、修改文件/usr/bin/yum
原版:
[root@muban ~]# cat /usr/bin/yum
#!/usr/bin/python
import sys
...
修改后:
[root@muban ~]# cat /usr/bin/yum
#!/usr/bin/python2.7
import sys
...
2、修改文件/usr/libexec/urlgrabber-ext-down
原版:
[root@muban ~]# cat /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python2.7
...
修改后:
[root@muban ~]# cat /usr/libexec/urlgrabber-ext-down
#! /usr/bin/python2.7
网友评论