yum安装软件报错:SyntaxError:invalid syntax

一、使用yum安装软件,报错信息

[root@izwz96tljwj636zfkf3wvqz ~]# 
[root@izwz96tljwj636zfkf3wvqz ~]# yum -y install openssl
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax
  File "/usr/libexec/urlgrabber-ext-down", line 28
    except OSError, e:
                  ^
SyntaxError: invalid syntax

Exiting on user cancel
[root@izwz96tljwj636zfkf3wvqz ~]#

二、原因和解决方案

python 版本问题,现在是python 3版本,需要改成2版本

vim /usr/libexec/urlgrabber-ext-down

将第一行的python改为python2即可。

三、参考

https://www.cnblogs.com/Trees/p/7497268.html

你可能感兴趣的:(Linux)