Perl Setting locale failed

You occasionally come across error messages like the following on new installations:

perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_TIME = "en_DK.utf8", LC_MONETARY = "en_DK.utf8", LC_MEASUREMENT = "en_DK.utf8", LC_NUMERIC = "en_DK.utf8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").

To fix it and set the local environment to en_US.UTF-8 execute the following in the command line.

export LANGUAGE=en_US.UTF-8 export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8 locale-gen en_US.UTF-8 dpkg-reconfigure locales

To see other available locales you can use the command

locale -a

If you still get error messages check the output of

dpkg-reconfigure locales

if it is complaining about other LC_ values, use the export command to set the correct values for these or generate the missing locale using the locale-gen command, e.g.
locale-gen en_DK.utf8

and run dpkg-reconfigure locales again.

Perl Setting locale failed
Share this