GCP数据存储模拟器不会安装在OpenJDK 10上

时间:2019-02-13 08:12:22

标签: java ubuntu google-cloud-platform google-cloud-datastore

我有一个Ubuntu主机,使用APT在其上安装了OpenJDK 10和Gloud SDK。当我尝试安装“ google-cloud-sdk-datastore-emulator”时,出现以下错误。 我在GCP GitHub上找到了一个讨论此问题的线程,但该线程已关闭。此处-https://github.com/GoogleCloudPlatform/cloud-sdk-docker/issues/144

还有其他人遇到这个问题吗?

错误-

//let urlHost : String = url.host as String!
//let mainStoryboard: UIStoryboard = UIStoryboard(name: "BLE", bundle: nil)
//if(urlHost == "BLELoginViewController")
//{
//    let innerPage: BLELoginViewController = mainStoryboard.instantiateViewController(withIdentifier: "BLELoginViewController") as! BLELoginViewController
//self.window?.rootViewController = innerPage
//}

我的环境-

操作系统-

# apt install google-cloud-sdk-datastore-emulator
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:
 google-cloud-sdk-datastore-emulator : Depends: openjdk-8-jdk but it is not installable
E: Unable to correct problems, you have held broken packages.

OpenJDK-

DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.2 LTS"
NAME="Ubuntu"
VERSION="18.04.2 LTS (Bionic Beaver)"

Gcloud SDK-

#java -version
openjdk version "10.0.2" 2018-07-17
OpenJDK Runtime Environment (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4)
OpenJDK 64-Bit Server VM (build 10.0.2+13-Ubuntu-1ubuntu0.18.04.4, mixed mode)
#javac -version
javac 10.0.2
#which java
/usr/bin/java

2 个答案:

答案 0 :(得分:2)

我们的debian软件包依赖性配置存在一些问题。 尽管如果您通过gcloud命令安装模拟器,它应该可以工作:

gcloud component install cloud-datastore-emulator

https://cloud.google.com/sdk/gcloud/reference/components/install

请注意,如果从其他程序包管理器中安装了sdk,则组件管理器将无法工作。在这种情况下,您可以删除它并按照以下建议进行安装:stackoverflow.com/questions/42697026

如果由于某些其他原因您必须通过apt-get安装,https://serverfault.com/questions/250224应该会有所帮助,基本上避免通过以下方式安装openjdk:

apt-get install google-cloud-sdk-datastore-emuilator openjdk-8-jdk-

请注意,openjdk-8-jdk后面有一个“-”

或者您可以按照同一线程中的步骤更新程序包依赖性。

答案 1 :(得分:0)

我的解决方案涉及使用equivs创建一个伪造的openjdk-8-jdk软件包(当然,您需要确保您拥有另一个JDK)。

apt-get install equivs
equivs-control openjdk-8-jdk
vim openjdk-8-jdk # especially change the package name, but I also used 11.0.0 as a version (although it's probably not needed)
equivs-build openjdk-8-jdk
dpkg -i openjdk-8-jdk*.deb