Debian – How to fix locale settings in Debian 7

debianlocale

I'm having massive problems with Debian's locale Settings.

I want my server to talk to me in standard English (en_US.UTF-8?) and additionally have de_DE.UTF-8 available for a few Python scripts that require it. I fudged around with pretty much all combinations of locale-gen, dpkg-reconfigure locales and editing of config files.

Now, when logging into my server, I'm greeted with this:

Last login: Fri Mar 13 22:23:14 2015 from 1.2.3.4
-bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (de_DE.UTF-8)

What does this even mean?

On my other server, I somehow managed to configure everything correctly, and locale -a correctly outputs the following there:

C
C.UTF-8
de_DE.utf8
en_US.utf8
POSIX

On this server, however, I only get this at the moment:

C
C.UTF-8
POSIX
en_US.utf8

How do I fix this?

Best Answer

Turns out that locale-gen refused to generate a de_DE locale because it was commented out in /etc/locale.gen.

locale.gen

As you can see here, I've uncommented the locales I want. After a quick locale-gen, everything worked again.

Related Question