歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 10.10升級到11.04過程中Python2.7升級出錯的解決方法(安裝wine過程中出錯)

Ubuntu 10.10升級到11.04過程中Python2.7升級出錯的解決方法(安裝wine過程中出錯)

日期:2017/2/28 16:13:57   编辑:Linux教程

Ubuntu 10.10默認python是2.6
Ubuntu 11.04默認python是2.7

這個問題貌似在debian上也會出現

現象就是升級python2.7 python2.7-minimal時提示
Preconfiguring packages ...
Setting up python2.7-minimal (2.7.1-1ubuntu4) ...
Linking and byte-compiling packages for runtime python2.7...
E: pycompile:240: Requested versions are not installed
dpkg: error processing python2.7-minimal (--configure):
subprocess installed post-installation script returned error exit status 3
Errors were encountered while processing:
python2.7-minimal

問題詳述可見 https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/693001

問題出在python2.7-minimal的postinst腳本會去執行
/usr/share/python/runtime.d/public_modules.rtinstall
腳本,在public_modules.rtinstall中需要執行
pycompile -V 2.7 /usr/lib/python2.7 ,而這時候python2.7根本還沒裝,就導致循環出錯了

相關討論見 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600529

解決方法:
在提示出錯後,修改 /usr/share/python/runtime.d/public_modules.rtinstall ,注釋掉所有的內容,
然後 apt-get -f install

待正常後,再執行一次 pycompile -V 2.7 /usr/lib/python2.7/dist-packages 就行了

Copyright © Linux教程網 All Rights Reserved