Friday, June 15, 2012

Debian: "perl: warning: Setting locale failed."

On my freshly installed Debian system, I kept getting this error message when using apt-get or perl:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = "en_US:en",
 LC_ALL = (unset),
 LC_CTYPE = "UTF-8",
 LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
If you have the same problem, well, the solution is quite easy. See that LC_ALL is unset ? All you have to do is add the following line to you bash profile (/etc/profile or ~/.bash_profile):
export LC_ALL="en_US.UTF8" # Put the adequate language and encoding here
Now open a new shell or source your profile in the current shell. Problem solved :)