2016-04-23 37 views
0

我想安裝maven但得到錯誤的軟件包。我嘗試使用-f開關,但它沒有幫助。由於破包,在Ubuntu的Maven安裝失敗

[email protected]:~$ sudo apt-get install -f maven 
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: 
maven : Depends: libaether-java but it is not going to be installed 
     Depends: libplexus-containers1.5-java but it is not going to be installed 
     Depends: libsisu-ioc-java but it is not going to be installed 
     Depends: libwagon-java but it is not going to be installed 
E: Unable to correct problems, you have held broken packages. 
+0

爲什麼不能下載[從Maven的立即下載頁面Maven的分佈(http://maven.apache.org/download.cgi)的解壓縮,並把bin文件夾路徑... – khmarbaise

回答

1

試試下面的命令:

#sudo apt-get remove maven2 
sudo add-apt-repository "deb http://ppa.launchpad.net/natecarlson/maven3/ubuntu precise main" 
sudo apt-get update 
sudo apt-get install maven3 

如果你遇到這樣的:

程序 'MVN' 可以在下面的包中找到:

行家

maven2

嘗試sudo易於得到安裝{選擇包}

#Just add those lines in /etc/profile 
export M2_HOME=/usr/share/maven3 
export M2=$M2_HOME/bin 
export PATH=$M2:$PATH 
+0

只能使用'export PATH = $ PATH:/ usr/share/maven3/bin'只有... – khmarbaise