获取错误 '/etc/environment: /usr/lib/jvm/java-8-openjdk-amd64: 权限被拒绝'

获取错误 '/etc/environment: /usr/lib/jvm/java-8-openjdk-amd64: 权限被拒绝'

运行命令时sudo apt-get install build-essential libssl-dev libffi-dev python-dev我得到以下输出。

Reading package lists... Done
Building dependency tree       
Reading state information... Done
build-essential is already the newest version (12.4ubuntu1).
libffi-dev is already the newest version (3.2.1-8).
python-dev is already the newest version (2.7.15~rc1-1).
libssl-dev is already the newest version (1.1.1-1ubuntu2.1~18.04.5).
0 upgraded, 0 newly installed, 0 to remove and 28 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up install-info (6.5.0.dfsg.1-2) ...
/usr/sbin/update-info-dir: 2: /etc/environment: /usr/lib/jvm/java-8-openjdk-amd64: Permission denied
dpkg: error processing package install-info (--configure):
 installed install-info package post-installation script subprocess returned error exit status 126
Errors were encountered while processing:
 install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)

我的 Java 配置有问题吗?

答案1

来自@steeldriver 的评论

这可能是语法错误/etc/environment

例如 :

JAVA_HOME= /usr/lib/jvm/java-8-openjdk-amd64

代替

JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64

相关内容