[Solved] yum command Error: “except keyboardinterrupt, e: syntax error: invalid syntax”“

Use the yum command prompt “except keyboardinterrupt, e: syntax error: invalid syntax”

Troubleshooting of error reporting using Yum command

Error reporting using Yum command

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

Reason for the problem:
Yum package management uses python2 X, python2 X to Python 3.0 After X, problems occurred due to Python version syntax compatibility

Solution:

Modify the yum configuration file to point the python version to the previous version

vi /usr/bin/yum
#!/usr/bin/python2.7

Modify the urlgrabber ext down file and change the python version

vi /usr/libexec/urlgrabber-ext-down
#!/usr/bin/python2.7

Read More: