Forum: 

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

volkswagner's picture

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 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
skz's picture

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 :)

Yalnark's picture

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