warning: Setting locale failed.
In many of my Digital Ocean's droplet I sometimes get this whenever I'm installing something:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_TIME = "es_CL.UTF-8",
LC_MONETARY = "es_CL.UTF-8",
LC_CTYPE = "en_US.UTF-8",
LC_ADDRESS = "es_CL.UTF-8",
LC_TELEPHONE = "es_CL.UTF-8",
LC_NAME = "es_CL.UTF-8",
LC_MEASUREMENT = "es_CL.UTF-8",
LC_IDENTIFICATION = "es_CL.UTF-8",
LC_NUMERIC = "es_CL.UTF-8",
LC_PAPER = "es_CL.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
Given it's just a warning, I tend to dismiss it. But when installing some packages, most notably postgres this may cause an issue.
How to solve it
Go to /etc/environment:
sudo vim /etc/environment
Append this the file:
LC_ALL="en_US.UTF-8"
or any other value. I'm in Chile, but I always use everything in English, so I chose en_US,
Then just the reboot the machine
sudo reboot
And that's it.
Written by Sebastián González
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Locale
Authors
thezombieguy
1.218K
apierzch
1.182K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#