Syntax error: Unterminated quoted string

5,014

The thing about error messages is that they tell you what's wrong.

Your error message clearly says that there is an unterminated quoted string in /etc/environment. Once you read that, you should investigate that file to see if it looks odd with regards to double quotes.

In a comment, you mention that your /etc/environment file has the contents:

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"

(or something similar, formatting is difficult in comments).

Here, you can clearly see that the :/usr/java/jre1.8.0_171/bin" bit at the end of the first line looks out of place (and a space too many).

You, or a script, have edited the file and messed up the PATH. That line now contains an unbalanced double quote.

My guess is that the PATH should be set as:

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"
Share:
5,014

Related videos on Youtube

user
Author by

user

A normal User

Updated on September 18, 2022

Comments

  • user
    user over 1 year

    I was updating my linux mint 18.3 to linux mint 19. The error I get is Cannot set LC_ALL to default locale: No such file or directory. Then I Restarted my System, after that I can't open the terminal. I used Ctrl+Alt+F3 to run command line and fixing the LC_ALL error by using the command sudo dpkg-reconfigure locales and sudo aptitude install locales and it worked. Then I tried to install terminal by using the command apt install gnome-terminal but it gives the error

    Setting up install-info (6.5.0.dfsg.1-2) ...
    /usr/sbin/update-info-dir: 5: /etc/environment: Syntax error: Unterminated quoted string
    dpkg: error processing package install-info (--configure):
     subprocess installed post-installation script returned error exit status 2
    Errors were encountered while processing:
     install-info
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    

    I tried to resolve that using this https://askubuntu.com/a/920076/842467 but nothing happened.

    • Kusalananda
      Kusalananda almost 6 years
      According to the error message, you have an unterminated quoted string in your /etc/environment file. Did you look at that?
    • user
      user almost 6 years
      My /etc/environment file looks like this PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbi‌​n:/bin:/usr/games:/u‌​sr/local/games" :/usr/java/jre1.8.0_171/bin" JAVA_HOME="/usr/java/jre1.8.0_171"
    • Kusalananda
      Kusalananda almost 6 years
      The :/usr/java/jre1.8.0_171/bin" bit looks out of place. Please add the contents of /etc/environment to the question so that we can see what it actually looks like.
  • user
    user almost 6 years
    I have changed JAVA_HOME="/usr/java/jre1.8.0_171" toJAVA_HOME="/usr/java/jre1.8.0_171/java" and PATH
  • Kusalananda
    Kusalananda almost 6 years
    @UjjwalSingh Since I'm not a Java user, I can't say whether that is correct or not.