perl: warning: Setting locale failed.

Issues related to applications and software problems
Post Reply
callie
Posts: 1
Joined: 2019/09/15 20:32:34

perl: warning: Setting locale failed.

Post by callie » 2019/09/15 20:45:17

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 !!

lightman47
Posts: 1522
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: perl: warning: Setting locale failed.

Post by lightman47 » 2019/09/30 18:12:06

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>
Last edited by lightman47 on 2019/09/30 18:17:54, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33232
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: perl: warning: Setting locale failed.

Post by TrevorH » 2019/09/30 18:17:48

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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply