Setting locale failed when running perl

General support questions
lin26b2b
Posts: 4
Joined: 2017/09/14 12:42:17

Setting locale failed when running perl

Postby lin26b2b » 2017/09/14 12:51:53

Hi all:

the locale on my server seemed to be incorrectly modified.
when running perl, I got such msg:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = "",
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").


in addition, when running R I encountered:

During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C"
2: Setting LC_COLLATE failed, using "C"
3: Setting LC_TIME failed, using "C"
4: Setting LC_MESSAGES failed, using "C"
5: Setting LC_MONETARY failed, using "C"
6: Setting LC_PAPER failed, using "C"
7: Setting LC_MEASUREMENT failed, using "C"


I used locale -a to check and found:

...
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
...

the output of cmd locale was:

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.utf8
LC_CTYPE="en_US.utf8"
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=


Could anyone please help me figure out how to fix this problem ?
Many many thanks!

my machine was: Linux version 2.6.32-642.1.1.el6.x86_64 , CentOS release 6.8 (Final)