yum install 出现如下错误: Loaded plugins: fastestmirror, langpacks SyntaxError: invalid syntax

 

CentOS 7升级Python到3.5后,我跟以前CentOS 6一样,在/usr/bin/python创建了一个指向Python 3的软连接,然后将/usr/bin/yum的顶部的:

!/usr/bin/python 
改成了

!/usr/bin/python2.7 

后,运行yum,还是出现了以下错误:

[root@vps ~]# yum -y install yum-priorities
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
 * base: ftp.iij.ad.jp
 * epel: ftp.kddilabs.jp
 * epel-debuginfo: ftp.kddilabs.jp
 * epel-source: ftp.kddilabs.jp
 * extras: ftp.iij.ad.jp
 * updates: ftp.iij.ad.jp
  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 
以前CentOS 6没这个问题的。

开了/usr/libexec/urlgrabber-ext-down看了下,发下他也使用了/usr/bin/python,于是跟前面一样,改为2.7,完成。

你可能感兴趣的:(Linux)