perl: warning: Setting locale failed.

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

perl: warning: Setting locale failed.

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


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

2. Adding following lines to /etc/environment

Code: Select all


Code: Select all

yum reinstall glibc-common

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

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

Posts: 1154
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.
Remember - importing/building packages will likely "byte you in the butt" come update time, long after you'd forgotten you did that! Use repos whenever possible.

User avatar
Forum Moderator
Posts: 28875
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.
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 6 - Software Support”