由于包损坏,maven安装在ubuntu上失败

时间:2016-04-23 19:50:04

标签: maven ubuntu-14.04 apt-get

我正在尝试安装maven但是因为破坏的软件包会出错。我也试过-f开关,但没有帮助。

simon@simon-pc:~$ 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.

1 个答案:

答案 0 :(得分: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 apt-get install {selected-package}

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