5

I bought a VPS, Centos 7.

However, I was able to understand what was going on with SSH and connected to my WHM.

After connecting, I get a list of errors and there is something like this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = (unset)
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

My system is the latest MacOS Mojave.

UPDATE: Finally it worked :) It was enough in the terminal in my system to enter these two commands.

export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8

The server is from the US, so I think that's why I had to set the language. The problem is now that if I turn off the terminal and turn it on again, I have to do the export command again. But it's already better than it was, I'm looking further ... :)

UPDATE 2:

I had to add these 2 lines, but to the file ~ / .bash_profile, now everything works even after the terminal is restarted.

5
  • 1
    are you executing a Perl script intentionally, or as a part of your login? It would help see that Perl script.
    – Jeff Schaller
    Commented Mar 6, 2019 at 17:36
  • The locale-related environment variables seems to be set incorrectly. You can remedy this by setting them correctly. Setting LC_ALL to the single character C or the string POSIX is a safe thing to do. You may also want to investigate your shell startup files to see if any LC_* variables are set in there, or at least set LC_CTYPE to C as well.
    – Kusalananda
    Commented Mar 6, 2019 at 17:44
  • @JeffSchaller - These errors appear immediately when I connect to the server. The only thing I write in the command is ssh root @ myip.
    – Maciej
    Commented Mar 6, 2019 at 17:53
  • @Kusalananda - I found that in the system it can be changed eg in the / etc / environment file. I gave there something like LANG = C and LC_ALL = C, unfortunately it did not help.
    – Maciej
    Commented Mar 6, 2019 at 17:54
  • Thanks @Maciej your update in the question helped me fix the issue. (but we need to close terminal and try again to verify if its working . :)
    – harshal
    Commented Jul 22, 2020 at 7:11

1 Answer 1

0

Installing

On Fedora, RHEL, Redhat, CentOS I used

sudo dnf install langpacks-de

for the german (de) language packs. Logged out and in and it worked.

Search for other langpacks with

dnf search langpacks-

Changing

To list available locales I used

localectl list-locales

And to set a new one

sudo localectl set-locale de_DE.utf8

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .