1. 程式人生 > >yum install 出現如下錯誤: Loaded plugins: fastestmirror, langpacks SyntaxError: invalid syntax

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,還是出現了以下錯誤:

[[email protected] ~]# 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,完成。