While setting up a lamp stack in a VPS using ubuntu 10 LTR, I got the following error:
Setting up php5-cli (5.3.2-1ubuntu4.5) ...
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.utf8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")
I was also getting a similar error from locale -a
locale -a
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_COLLATE to default locale: No such file or directory
It appears this VPS provider doesn’t have any locales installed by default. I fixed it by installing my locale via apt-get.
apt-get install language-pack-en-base
Update – 1-23-2011
If your using debian instead of ubuntu, see http://people.debian.org/~schultmc/locales.html
- Install debconf (i.e. run apt-get update then apt-get install debconf, as root)
- Run dpkg-reconfigure locales as root