apt-get 不再起作用了

apt-get 不再起作用了

我正在使用 Ubuntu 10.04
每當我嘗試執行 sudo apt-get install 時都會收到此錯誤

(此範例適用於 sudo apt-get install virtualbox)

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting virtualbox-3.2 instead of virtualbox
virtualbox-3.2 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
Setting up apache (1.3.34-2ubuntu0.1) ...
dpkg: error processing apache (--configure):
 subprocess installed post-installation script returned error exit status 10
Setting up lynx (2.8.5-2ubuntu1) ...
update-alternatives: error: alternative path /usr/bin/lynx doesn't exist.
dpkg: error processing lynx (--configure):
 subprocess installed post-installation script returned error exit status 2
Processing triggers for menu ...
Errors were encountered while processing:
 apache
 lynx
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

注意:在此過程中,您的 apache 和 lynx 將被刪除並重新安裝

嘗試關注 這應該刪除你的 apache 和 lynx

sudo dpkg -r lynx

須藤 dpkg -r 阿帕契

然後嘗試

sudo apt-get -f 自動刪除

sudo apt-get -f 安裝

sudo apt-get 更新

sudo apt-get install apache2 lynx

答案2

您的 apache 和 lynx 安裝有問題。很難說到底是什麼損壞了,或是為什麼損壞了。您可以嘗試刪除 lynx 和 apache 並重新安裝它們。

答案3

實際上,您可以安裝和升級軟體包,只要它們不依賴lynxapache。儘管如此,您應該盡快解決這個問題。

這兩個軟體包的安裝過程都被阻止,因為安裝後腳本回傳錯誤。您需要修復或解決每個錯誤。

對於lynx,該訊息alternative path /usr/bin/lynx doesn't exist表示您目前安裝的 lynx 有問題。僅將軟體包升級到 10.04 中的版本就可能解決該問題,因此請先嘗試 ( apt-get install lynx-cur lynx)。否則,解決此問題的最簡單方法可能是刪除該lynx軟體包並重新安裝。

對於apache,您目前也安裝了 8.04 的版本。如果您無論如何都要升級,請先嘗試取得最新版本:apt-get install apache。如果這不起作用,您需要找出到底是什麼導致了錯誤。編輯/var/lib/dpkg/info/apache.postinst並添加set -x為文件的第二行,然後運行dpkg --configure apache並觀察追蹤。如果您無法找出問題所在,請發布該追蹤。

相關內容