0

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?

Michael Ef
  • 1
  • 1
  • 5

2 Answers2

1

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.

dsmsk80
  • 5,817
  • 18
  • 22
  • I already tried update-locale and as I wrote I added the posted configuration to /etc/default/locale. – Michael Ef Aug 30 '13 at 06: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 07: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
0

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

Basil
  • 16