Jens Segers on Nov 28 2012

Ubuntu locale warning

While working on my personal Ubuntu server, I often run into the following locale warnings.

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

First you should check if there is anything wrong with your locales. Execute the following commands:

> locale-gen en_US.UTF-8
> sudo dpkg-reconfigure locales

Funny enough, the warning messages also appear when executing that last command. If we inspect the warning messages we see that LC_ALL is not set. You can set this value by adding it to the /etc/default/locale file:


There you go, relog and the warnings should be gone.


Jens Segers 5 years ago

@DaveBowman, No RSS feed yet :)

DaveBowman 5 years ago

Thanks, it really helped! BTW, why don't you have an RSS-feed? Pity I can't subscribe with Google Reader.