TurnKey Linux Virtual Appliance Library

Locales error ---perl: warning: Setting locale failed

I have searched and tried all viable solutions.
I keep getting the same error.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        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_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

I have tried the following:

apt-get remove locales
apt-get install locales
dpkg-reconfigure locales
localdef -i en_US-f /usr/share/i18n/charmaps UTF-8
Alon Swartz's picture

you can safely ignore the warning, but...

You can safely ignore the perl warning:
perl: warning: Falling back to the standard locale ("C").
But I see you have changed the default LANG, which I am guessing is causing the other errors.
The default locale on the appliances are en_GB.

The correct way to get rid of the warning would be to just set it to its fallback setting export LC_ALL=C, and update /etc/environment to persist reboots...

You might want to try the following:
export LANG=en_GB
export LC_ALL=C

locale-gen $LANG
echo LANG=$LANG >> /etc/environment
echo LC_ALL=$LC_ALL >> /etc/environment

You might want to

You might want to try

update-locale LANG=en_GB LC_ALL=C

which should update the locale file. Logout and login again and BAM - solved :)

This works like charm !!

update-locale LANG=en_GB LC_ALL=C

which should update the locale file. Logout and login again and BAM - solved :)

Worked for me.. wow !!

Thanks.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr> <br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong> <font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <strike> <caption>

More information about formatting options

Leave this field empty. It's part of a security mechanism.
(Dear spammers: moderators are notified of all new posts. Spam is deleted immediately)