yum运行报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax

时间:2022-04-26 11:45:38

yum运行报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax

这是由于Python升级导致

备份Python 历史版本

[root@sdw1 autoconf]# ls /usr/bin/python*

yum运行报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax

[root@sdw1 autoconf]# mv /usr/bin/python2.7_back /usr/bin/python2.7

[root@sdw1 autoconf]# vim /usr/bin/yum

yum运行报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax

保存退出后运行yum 命令查看是否正常

已正常运行

yum运行报错:File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^SyntaxError: invalid syntax