我無法在我的系統上安裝 maven 我嘗試使用以下命令:
sudo apt-get install maven
它給了我以下錯誤:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libperl5.22 : Depends: perl-modules-5.22 (>= 5.22.1-9ubuntu0.2) but 5.22.1-9 is to be installed
maven : Depends: libmaven3-core-java (= 3.3.9-3) but it is not going to be installed
perl : Depends: perl-modules-5.22 (>= 5.22.1-9ubuntu0.2) but 5.22.1-9 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我不知道這裡發生了什麼以及如何安裝它。
答案1
正如錯誤訊息所示“apt-get -f install
不帶包運行”:
sudo apt-get install -f
如果這沒有幫助,您的軟體包可能(部分)已過時。更新它們,同時再次修復依賴問題 ( -f
):
sudo apt-get update
sudo apt-get upgrade -f
(您也可以附加maven
到後一個命令,嘗試將其與升級和依賴項修復一起安裝。)
如果apt-get update
本身導致錯誤,請在繼續之前嘗試修復它們。在「詢問 Ubuntu」中搜尋錯誤訊息1或提出新問題。
1有時,Google 是比整合到 Stack Exchange 中的搜尋引擎更好的搜尋引擎。您可以使用運算子將 Google 搜尋限制為一個網域site:
,例如site:askubuntu.com Unmet dependencies
.
答案2
它可能看起來很假,但你sudo apt-get -f install
按照它的建議運行了嗎?