➜ ChessV sudo apt-get -f install install-info
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
install-info is already the newest version (6.8-4build1).
0 upgraded, 0 newly installed, 0 to remove and 187 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.8-4build1) ...
/usr/sbin/update-info-dir: 4: /etc/environment: Syntax error: Unterminated quoted string
dpkg: error processing package install-info (--configure):
installed install-info package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
install-info
E: Sub-process /usr/bin/dpkg returned an error code (1)
我试过 -f 安装一个包,我甚至试过重新安装 install-info 包,但它似乎不起作用,我也无法更新我的 ubuntu 或安装任何其他包
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" JAVA_HOME="JAVA_HOME="/lib/jvm/java-11-openjdk-amd64/bin/java"
答案1
我的系统上该文件的内容/etc/environment
只有一行,如下所示:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
我正在运行 Ubuntu 22.10。
请检查您系统上的文件。您可能"
在行尾缺少双引号 ( ),或者文件中可能存在其他缺失或多余的数据。
如您所见,文件内容包含无关信息。第一部分(以 开头PATH=
)与我的相同。但是,该行的其余部分(以 开头JAVA_HOME=
)应放在单独的行中,然后删除重复的部分(JAVA_HOME="
)。你的文件应该是这样的:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
JAVA_HOME="/lib/jvm/java-11-openjdk-amd64/bin/java"
但是,我建议检查第二行是否真的需要,因为您的系统上可能没有安装 JAVA。请使用以下命令检查:
$ file /lib/jvm/java-11-openjdk-amd64/bin/java
/lib/jvm/java-11-openjdk-amd64/bin/java: cannot open `/lib/jvm/java-11-openjdk-amd64/bin/java' (No such file or directory)
如果(No such file or directory)
如上例所示,您可以完全删除第二行,只保留第一行,就像我在第一个例子中给您的那样。
您可以使用以下命令之一编辑文件:
$ sudo vi /etc/environment
$ gedit admin:///etc/environment
$ gnome-text-editor admin:///etc/environment