/usr/sbin/update-info-dir: 4: /etc/environment: 语法错误:未终止的引用字符串

Cot*_*ton 2 package-management apt dpkg software-installation

我不断得到这个:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  geoip-database-extra gir1.2-ayatanaappindicator3-0.1 gir1.2-gexiv2-0.10
  libayatana-appindicator3-1 libayatana-indicator3-7 libjs-openlayers libnl-route-3-200
  libqt5multimedia5 libsmi2ldbl libwireshark-data libwireshark10 libwiretap7 libwscodecs1
  libwsutil8 python-bs4 python-certifi python-configobj python-html5lib python-httplib2
  python-lxml python-olefile python-openssl python-pil python-pycurl python-requests
  python-urllib3 python-webencodings wireshark wireshark-common wireshark-qt
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 34 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up install-info (6.5.0.dfsg.1-2) ...
/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)
Run Code Online (Sandbox Code Playgroud)

的输出cat /etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jre1.8.0_171/bin"
    JAVA_HOME="/usr/java/jre1.8.0_171
Run Code Online (Sandbox Code Playgroud)

N0r*_*ert 5

您应该使用文本编辑器编辑您的/etc/environment并在其中添加最后一个引号 ( ")。
以纳米为例:

sudo nano /etc/environment
Run Code Online (Sandbox Code Playgroud)

改变

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jre1.8.0_171/bin"
JAVA_HOME="/usr/java/jre1.8.0_171
Run Code Online (Sandbox Code Playgroud)

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/java/jre1.8.0_171/bin"
JAVA_HOME="/usr/java/jre1.8.0_171"
Run Code Online (Sandbox Code Playgroud)

Ctrl+O保存,然后Ctrl+X退出。