Debian Squeeze locale settings

regularfry asked:

I have a problem with a slightly customised Debian image that I’m trying to do some headless work on. The problem is that the installed locales list has been reduced to this:


However, when I log in as root (with an otherwise as-vanilla profile), I find this:

~# set | grep LC_

That’s the only LC_ environment variable set, and presumably that means that it’s being explicitly set somewhere (and given that /etc/default/locale only contains LANG=en_GB, I can’t see any other alternative). However, I can’t see where it is being set, and the fact that it’s wrong is preventing, for example, postgresql-8.4 from installing. I know I can do an

LC_CTYPE=en_GB apt-get install postgresql-8.4

to work around this, but I’d really like to understand where this setting comes from, and I really dislike the idea of installing an otherwise-unnecessary locale to make this go away. So: where does this LC_CTYPE setting come from, and how do I make it go away?

My answer:

You can install the missing locales:

apt-get install debconf
dpkg-reconfigure locales

Choose the locales you would like to install.

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.