File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: ^ SyntaxError: invalid syntax
解决步骤:
#vi /usr/bin/yum
将#!/usr/bin/python改为#!/usr/bin/python2.7
退出保存
相关错误:
【https://linuxconfig.org/how-to-switch-between-python-versions-on-fedora-linux】
Similarly: Error message:
Downloading packages: File "/usr/libexec/urlgrabber-ext-down", line 28 except OSError, e: ^ SyntaxError: invalid syntax Exiting on user cancel
The issue is also related to Python 3 set as a default global version. To fix this error update /usr/libexec/urlgrabber-ext-down
script:
# vi /usr/libexec/urlgrabber-ext-down FROM: #!/usr/bin/python TO: #!/usr/bin/python2.7