最近將一臺測試伺服器操作系統升級到了Cent0S 7.5,然後順便也將Python從2.7.5升級到Python 3.6.6,升級完成後,發現yum安裝相關包時出現異常,報“File "/usr/libexec/urlgrabber-ext-down", line 28”這樣的錯誤, 具體錯誤信息如... ...
最近將一臺測試伺服器操作系統升級到了Cent0S 7.5,然後順便也將Python從2.7.5升級到Python 3.6.6,升級完成後,發現yum安裝相關包時出現異常,報“File "/usr/libexec/urlgrabber-ext-down", line 28”這樣的錯誤, 具體錯誤信息如下所示:
# yum install openssl
..........................
Total download size: 1.7 M
Is this ok [y/d/N]: y
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
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
測試、驗證了一下,可以用下麵這種方法解決這個問題:
修改/usr/libexec/urlgrabber-ext-down中的Python版本信息
vi /usr/libexec/urlgrabber-ext-down 將/usr/bin/python改為/usr/bin/python2.7。