Hello, I’m a web craftsman with a passion for the modern web. I build web applications and play with social services and communities.

March 29, 2013 at 11:30 pm

After booting a fresh EC2 instance with Ubuntu 12.10 this showed up right after login:

WARNING! Your environment specifies an invalid locale.
This can affect your user experience significantly, including the
ability to manage packages.

And when running some apt-get commands I got this:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "de_DE.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_ALL to default locale: No such file or directory

There are plenty of supposed solutions out there but none worked for me but this one:

# add this line to /etc/environment; then reboot
LC_ALL="en_US.UTF-8"