Page 1 of 1

perl: warning: Setting locale failed.

Posted: 2019/09/15 20:45:17
by callie
Hi,

I am using centos release CentOS release 6.9 (Final). For the past 15 days I am getting the following error.

Code: Select all

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.utf8",
        LC_ALL = "en_US.utf8",
        LC_TYPE = "en_US.utf8",
        LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
[kalyani_patankar@ngs 135-2019-26]$ cat /etc/centos-release
I have tried several solutions for this from different forums

1. Creating a /etc/default/locale file with
cat /etc/default/locale

Code: Select all

LANG=en_US.utf8
LC_ALL=en_US.utf8
2. Adding following lines to /etc/environment

Code: Select all

LANGUAGE=en_US.utf8
LC_ALL=en_US.utf8
LANG=en_US.utf8
LC_TYPE=en_US.utf8
3.

Code: Select all

yum reinstall glibc-common
4.

Code: Select all

 localedef -i en_US -f UTF-8 en_US.UTF-8
    localedef -i en_US -f UTF-8 en_US.UTF-8
    localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
    localedef -c -i en_US -f UTF-8 en_US.UTF-8
5. yum update

None of the above approaches seem to work.

My current gcc version is

gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I am a bioinformatician and several of my programs like fastq, bwa, and samtools are not working if this issue is not resolved. These tools work fine if I operate as root.

I will appreciate any help as I can not understand how to resolve this.

Thanks in advance !!

Re: perl: warning: Setting locale failed.

Posted: 2019/09/30 18:12:06
by lightman47
If it were me/my thoughts (I am NO expert) -

My un-educated guess is that some file 'update'/copy/move was done 15 days ago and 'permissions' got clobbered.

When solved, run yum update <wink>

Re: perl: warning: Setting locale failed.

Posted: 2019/09/30 18:17:48
by TrevorH
Start by running yum update to get your system to 6.10 which has been out for more than a year and is the only supported CentOS 6 version. Once that's complete you need to reboot into the new kernel and updated libraries. If the problem persists then try running rpm -Va perl\* glibc\* and see what is reported as not matching the correct info held by rpm.