使用apt-get在Google Compute Engine实例上安装Java 8 [英] Installing Java 8 on a Google Compute Engine instance with apt-get

查看:73
本文介绍了使用apt-get在Google Compute Engine实例上安装Java 8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用apt-get运行了此命令,但收到此错误.我不太确定该如何解决.这是我使用apt-get犯的核心错误,要求做一些不可能的事情吗?有人知道阻止其安装的根本原因吗?

I ran this command with apt-get but have received this error. I am not too sure how to resolve this. Is this come core mistake I have made using apt-get, asking for something impossible? Does anyone understand the root cause that prevents it from installing?

sudo apt-get install openjdk-8-jdk                                                                                       
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:
 openjdk-8-jdk : Depends: openjdk-8-jre (= 8u171-b11-1~bpo8+1) but it is not going to be installed
                 Depends: openjdk-8-jdk-headless (= 8u171-b11-1~bpo8+1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

推荐答案

这是一个班轮

sudo apt-get -y install default-jdk
java -version

这篇关于使用apt-get在Google Compute Engine实例上安装Java 8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆