Fixing “perl: warning: Setting locale failed” On Ubuntu

Ubuntu Logo

If you’re ever faced with this warning, which usually happens on a fresh Ubuntu installation:

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

You can fix it easily by doing the following:

locale-gen "en_US.UTF-8"

And then run:

dpkg-reconfigure locales

Locales are a framework to switch between multiple languages and allow users to use their language, characters and collation orders.

Any questions or comments? Please post below!

 

Leave a Reply

Your email address will not be published. Required fields are marked *