Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a fresh installation of Ubuntu 12.04 as virtual openVZ guest. The defined locale for LC_* in basic setup is POSIX.

I'd like to change this to en_US.UTF-8. So I installed language_pack_en_base and language_pack_en, ran dpkg-reconfigure locales and added the following lines to /etc/environment and /etc/default/locale:

LANG=en_US.UTF-8
LC_CTYPE=C
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8

But after restarting the virtual machine the output of locale is:

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=

What else can I do to set en_US.UTF-8 as locale for this server?

share|improve this question

2 Answers 2

There is a file /etc/default/locale for persistent setting of system locales. Alternatively, you can use update-locale command instead of direct editing of that file.

More about locale settings can be found on Ubuntu community help.

share|improve this answer
    
I already tried update-locale and as I wrote I added the posted configuration to /etc/default/locale. –  Michael Ef Aug 30 '13 at 6:57
    
Do you have it in /var/lib/locales/supported.d/local ? There should be a line en_US.UTF-8. Then, run reconfigure again. –  dsmsk80 Aug 30 '13 at 7:25
    
Yes, I have. Regenerating the locales had no effect. If I export the variables on command line it takes effect. But after rebooting it always is POSIX –  Michael Ef Aug 30 '13 at 13:00

In my case when logging in with ssh none of the usual default locale or environment variable settings seemed to work. It was because I had disabled PAM session control in sshd configuration.

Make sure you have set

UsePAM yes 

in your /etc/ssh/sshd_config file

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.