在CHROOT环境中工作 - 尝试安装JDK时出错

时间:2017-06-15 15:30:44

标签: java linux command-line install

我目前正在为ARM设备(即Odroid C1 +)设置我自己的Ubuntu 16.04映像。由于我想自定义最小的Ubuntu工作正常,我想安装包" zookeeperd"。

sudo apt-get install zookeeperd

执行此操作时,会出现以下错误:

sudo: unable to resolve host dualboot
Reading package lists... Done
Building dependency tree       
Reading state information... Done
zookeeperd is already the newest version (3.4.8-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
Setting up ca-certificates-java (20160321) ...
the keytool command requires a mounted proc fs (/proc).
dpkg: error processing package ca-certificates-java (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of openjdk-8-jre-headless:armhf:
 openjdk-8-jre-headless:armhf depends on ca-certificates-java; however:
  Package ca-certificates-java is not configured yet.

dpkg: error processing package openjdk-8-jre-headless:armhf (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-8-jre:armhf:
 openjdk-8-jre:armhf depends on openjdk-8-jre-headless (= 8u131-b11-0ubuntu1.16.04.2); however:
  Package openjdk-8-jre-headless:armhf is not configured yet.

dpkg: error processing package openjdk-8-jre:armhf (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of zookeeper:
 zookeeper depends on default-jre-headless | java6-runtime-headless; however:
  Package default-jre-headless is not installed.
  Package java6-runtime-headless is not installed.
  Package openjdk-8-jre-headless:armhf which provides java6-runtime-headless is not configured yet.

dpkg: error processing package zookeeper (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of zookeeperd:
 zookeeperd depends on zookeeper (= 3.4.8-1); however:
  Package zookeeper is not configured yet.

dpkg: error processing package zookeeperd (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of openjdk-8-jre-jamvm:armhf:
 openjdk-8-jre-jamvm:armhf depends on openjdk-8-jre-headless (= 8u131-b11-0ubuntu1.16.04.2); however:
  Package openjdk-8-jre-headless:armhf is not configured yet.

dpkg: error processing package openjdk-8-jre-jamvm:armhf (--configure):
 dependency problems - leaving unconfigured
Processing triggers for ca-certificates (20160104ubuntu1) ...
Updating certificates in /etc/ssl/certs...
0 added, 0 removed; done.
Running hooks in /etc/ca-certificates/update.d...

the keytool command requires a mounted proc fs (/proc).
E: /etc/ca-certificates/update.d/jks-keystore exited with code 1.
done.
Errors were encountered while processing:
 ca-certificates-java
 openjdk-8-jre-headless:armhf
 openjdk-8-jre:armhf
 zookeeper
 zookeeperd
 openjdk-8-jre-jamvm:armhf
E: Sub-process /usr/bin/dpkg returned an error code (1)

您是否经历过相同或有线索如何解决错误?我发现类似的东西是:Error installing JDK: the keytool command requires a mounted proc fs (/proc). Windows subsystem for Linux 但我想澄清一点,我既不是Windows 10的Linux子系统,也不是虚拟机!

1 个答案:

答案 0 :(得分:1)

解决方案就像这样:https://superuser.com/questions/165116/mount-dev-proc-sys-in-a-chroot-environment

请执行以下操作:

在主机上:

  mount --bind /proc <chroot dir>/proc 

和另一种语法(在chroot环境中):

  mount -t proc none /proc