Ubuntu
無法在 Ubuntu 12.04.2 LTS 上安裝 python2.7-dev
該命令
$ sudo apt-get install python2.7-dev
產生以下結果:Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: python2.7-dev : Depends: libexpat1-dev but it is not going to be installed E: Unable to correct problems, you have held broken packages.
我已經執行
sudo apt-get update
,sudo apt-get upgrade
並且sudo apt-get dist-upgrade
在執行安裝命令之前。我嘗試將儲存庫伺服器從本地伺服器(捷克共和國)切換到主伺服器。我嘗試使用 aptitude 安裝軟體包,結果是:The following NEW packages will be installed: libexpat1-dev{ab} libssl-dev{a} libssl-doc{a} python2.7-dev 0 packages upgraded, 4 newly installed, 0 to remove and 0 not upgraded. Need to get 32.4 MB of archives. After unpacking 47.9 MB will be used. The following packages have unmet dependencies: libexpat1-dev : Depends: libexpat1 (= 2.0.1-7.2ubuntu1.1) but 2.1.0-1ubuntu1 is installed. The following actions will resolve these dependencies: Keep the following packages at their current version: 1) libexpat1-dev [Not Installed] 2) python2.7-dev [Not Installed] Accept this solution? [Y/n/q/?] Y No packages will be installed, upgraded, or removed. 0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Need to get 0 B of archives. After unpacking 0 B will be used.
aptitude 建議的“解決方案”實際上並沒有做任何事情,也沒有任何效果。列印出上述內容後,它存在,沒有錯誤程式碼或任何錯誤消息。
我曾嘗試刪除 libexpat1,但我需要的軟體包太多依賴於它,其中似乎包括大量的 gnome。
我嘗試過的任何事情都沒有任何效果,安裝命令的結果仍然相同。
我在網上搜尋了這個問題,發現似乎與我的問題相關的文章很少,但儘管它們可能已“解決”,但它們都沒有以任何方式幫助我(這是我在詢問之前沒有關閉的兩個這個問題):
這裡有趣的一點是:
libexpat1-dev : Depends: libexpat1 (= 2.0.1-7.2ubuntu1.1) but 2.1.0-1ubuntu1 is installed.
根據線上包搜尋工具,12.04 LTS
libexpat1
為2.0.1-7.2ubuntu1.1
和precise
.precise-updates
問題是,您最初是如何2.1.0-1ubuntu1
安裝版本的?使用
aptitude()
互動式 UI,您可以搜尋libexpat1
並選擇合適的版本進行安裝,即降級軟體包以匹配libexpat1-dev
依賴項。您也可以從命令行執行此操作:
sudo aptitude install package=version