I have a Debian 6 (64-bit) VPS where I cannot seem to get the locale environment variables LANG and LC_* set. (Everything below as root).
vps:~# locale -a C POSIX en_US.utf8 nl_NL.utf8 vps:~# locale LANG= LANGUAGE= LC_CTYPE="POSIX" LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL= vps:~# cat /etc/default/locale # File generated by update-locale LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 LC_COLLATE=POSIX
This should override the locale settings provided via my SSH client, but the default locale settings take no effect.
.profile, .bashrc, /etc/environment and /etc/profile do not contain any locale settings. I also haven't found any other locations from where these environment variables are sourced.
me:~# grep "LANG" ~/.profile ~/.bashrc /etc/environment /etc/profile me:~# grep "LC_" ~/.profile ~/.bashrc /etc/environment /etc/profile me:~#
My SSH client settings are not taking effect either, while they do on other VPSes. Locally, I have in my /etc/ssh/ssh_config:
SendEnv LANG LC_*
And on the VPS, /etc/ssh/sshd_config contains:
# Allow client to pass locale environment variables AcceptEnv LANG LC_*
I'm not sure if it's required for the variables to take effect, but my VPS's /etc/pam.d/login contains:
# locale variables are also kept into /etc/default/locale in etch # reading this file *in addition to /etc/environment* does not hurt session required pam_env.so readenv=1 envfile=/etc/default/locale
And /etc/pam.d/sshd contains:
# Read environment variables from /etc/environment and # /etc/security/pam_env.conf. auth required pam_env.so #  # In Debian 4.0 (etch), locale-related environment variables were moved to # /etc/default/locale, so read that as well. auth required pam_env.so envfile=/etc/default/locale
/etc/security/pam_env.conf contains only commented options)
So, it seems something is not allowing either my /etc/default/locale or my SSH client's locale settings to take effect, so it defaults to POSIX (or something is forcing POSIX explicitly). Any clues what could be interfering? Or ideas how to find out what it is?
I can do
export LC_CTYPE=en_US.UTF-8 etc. in my .bashrc, and that does work. However I'm trying to understand this behavior, which is different from that on other Debian (6 or 7) installations I'm working with.
Edit: some more details:
- I have rebooted the system, no effect;
- /etc/ssh/sshd_config has
- I've also tried using
en_US.utf8as alternative name in