If you use Ubuntu in the cloud, specifically in AWS, you may see this warning message after SSHing into your server:
WARNING! Your environment specifies an invalid locale. This can affect your user experience significantly, including the ability to manage packages.
If you than try to install any new packages with apt-get
or even restart/reload an existing service, you may get this error message:
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
The fix is pretty simple. Edit the /etc/environment
file and put this line at the end of it:
LC_ALL="en_US.UTF-8"
Save the file, log out and log back into you instance. You should be good. If that doesn’t work, you can try to put these lines in /etc/default/locale
instead:
LANG="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
Thanks worked on my laptop!
Yay, that’s awesome! I’m delighted it was helpful.
Both solutions did not work for me.
There still this error :
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = “en_US:en”,
LC_ALL = (unset),
LC_TIME = “de_LI.UTF-8”,
LC_MONETARY = “de_LI.UTF-8”,
LC_ADDRESS = “de_LI.UTF-8”,
LC_TELEPHONE = “de_LI.UTF-8”,
LC_NAME = “de_LI.UTF-8”,
LC_MEASUREMENT = “de_LI.UTF-8”,
LC_IDENTIFICATION = “de_LI.UTF-8”,
LC_NUMERIC = “de_LI.UTF-8”,
LC_PAPER = “de_LI.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_ALL to default locale: No such file or directory
Dankonino, thanks for stopping by! How about one of the solutions described on this page? http://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue
you can try reinstall locale with apt-get install –reinstall locales
more read here http://linux-ubuntu.info/en/how-to-change-the-default-locale/
Thanks for the suggestion, Vlad!