Justin Lilly

The simplest thing that could possibly work.

Mar 11

perl: warning: Setting locale failed.

I got the following errors when running apt-get update on my rackspace cloud ubuntu servers:

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

The fix, though simple, was a bit difficult to find. For those with the same problem, here’s what it takes to fix it:


sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales

Page 1 of 1