无法安装 openjdk-7-jdk 和 openjdk-7-jre

无法安装 openjdk-7-jdk 和 openjdk-7-jre

当我跑步时

sudo apt-get install openjdk-7-jdk

我收到此错误

$ sudo apt-get install openjdk-7-jdk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package openjdk-7-jdk is a virtual package provided by:
  oracle-java9-installer 9b123+9b123arm-1~webupd8~0
  oracle-java8-installer 8u92+8u91arm-2~really8u91~webupd8~0
  oracle-java7-installer 7u80+7u60arm-0~webupd8~1
You should explicitly select one to install.
E: Package 'openjdk-7-jdk' has no installation candidate


$ sudo apt-get install oracle-java-7-installer

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package oracle-java-7-installer


$ sudo apt-get install openjdk-7-jdk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package openjdk-7-jdk is a virtual package provided by:
  oracle-java9-installer 9b123+9b123arm-1~webupd8~0
  oracle-java8-installer 8u92+8u91arm-2~really8u91~webupd8~0
  oracle-java7-installer 7u80+7u60arm-0~webupd8~1
You should explicitly select one to install. 
E: Package 'openjdk-7-jdk' has no installation candidate


$ sudo apt-get install oracle-java7-installer

Reading package lists... Done
Building dependency tree       
Reading state information... Done
oracle-java7-installer is already the newest version (7u80+7u60arm-0~webupd8~1).
0 upgraded, 0 newly installed, 0 to remove and 79 not upgraded.


$ sudo apt-get install openjdk-7-jdk

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package openjdk-7-jdk is a virtual package provided by:
  oracle-java9-installer 9b123+9b123arm-1~webupd8~0
  oracle-java8-installer 8u92+8u91arm-2~really8u91~webupd8~0
  oracle-java7-installer 7u80+7u60arm-0~webupd8~1
You should explicitly select one to install.
E: Package 'openjdk-7-jdk' has no installation candidate

答案1

我遇到了同样的问题,但运行以下命令后我可以安装它:

sudo apt-get install -f
sudo add-apt-repository ppa:openjdk-r/ppa  
sudo apt-get update
sudo apt-get install openjdk-7-jre 

答案2

我能够使用以下命令解决问题,

%sh sudo apt-get -y --allow-change-held-packages install openjdk-8-jdk

相关内容