无法在 Ubuntu 12.04 中安装 Java JDK:损坏的软件包

1 java

我尝试输入这个来安装java JDK

 sudo apt-get install openjdk-7-jdk
Run Code Online (Sandbox Code Playgroud)

它用这个回应

Reading package lists... Done
Building dependency tree... 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:
 openjdk-7-jdk : Depends: openjdk-7-jre (= 7u55-2.4.7-1ubuntu1~0.12.04.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Run Code Online (Sandbox Code Playgroud)

我不知道如何处理这个问题。

小智 6

这是我通常安装 JDK 的方式(从终端)

须藤添加-apt-repository ppa:webupd8team/java

sudo apt-get 更新

sudo apt-get install oracle-java7-installer

更多说明请访问https://launchpad.net/~webupd8team/+archive/java