Hi,
On a fresh CentOS 7 installation using Français/France as regional parameters in the installer, here's what localectl looks like:
[microlinux@linuxbox ~]$ localectl System Locale: LANG=fr_FR.UTF-8 VC Keymap: ch-fr X11 Layout: ch X11 Variant: fr
Now I'd like to have my system messages in english. So I set the system language accordingly:
$ sudo localectl set-locale LANG=en_US.utf8
Things seem to look OK now:
[microlinux@linuxbox ~]$ localectl System Locale: LANG=en_US.utf8 VC Keymap: ch-fr X11 Layout: ch X11 Variant: fr
Except when I display my LANG variable, it's still fr_FR.UTF-8 for normal users... but en_US.utf8 for root.
This looks like inconsistent or buggy behavior to me.
Any suggestions on how to change the default system locale LANG so that it's en_US.utf8 for everybody *without* having to jump through burning loops and putting it in everybody's ~/.bashrc ?
Cheers,
Niki
Le 15/05/2021 à 12:48, Nicolas Kovacs a écrit :
Except when I display my LANG variable, it's still fr_FR.UTF-8 for normal users... but en_US.utf8 for root.
This looks like inconsistent or buggy behavior to me.
OK, I experimented some more, and now I'm puzzled.
1. When I'm connected directly (physically) to the server, LANG is set correctly: en_US.utf8 for both root and non-root users.
2. When I'm opening a remote SSH session, LANG is set to fr_FR.UTF_8 for both root and non-root users.
What's going on here ?
Le 15/05/2021 à 12:48, Nicolas Kovacs a écrit :
Except when I display my LANG variable, it's still fr_FR.UTF-8 for normal users... but en_US.utf8 for root.
This looks like inconsistent or buggy behavior to me.
OK, I experimented some more, and now I'm puzzled.
- When I'm connected directly (physically) to the server, LANG is set
correctly: en_US.utf8 for both root and non-root users.
- When I'm opening a remote SSH session, LANG is set to fr_FR.UTF_8 for
both root and non-root users.
What's going on here ?
Hi Nicolas,
it works as expected because SSH sends these vars:
/etc/ssh/ssh_config: SendEnv LANG LC_CTYPE LC_NUMERIC ...
/etc/ssh/sshd_config: AcceptEnv LANG LC_CTYPE LC_NUMERIC ...
Regards, Simon
Le 15/05/2021 à 14:34, Simon Matter a écrit :
it works as expected because SSH sends these vars:
/etc/ssh/ssh_config: SendEnv LANG LC_CTYPE LC_NUMERIC ...
/etc/ssh/sshd_config: AcceptEnv LANG LC_CTYPE LC_NUMERIC ...
Thanks very much !
Niki
On 15.05.21 12:48, Nicolas Kovacs wrote:
Hi,
On a fresh CentOS 7 installation using Français/France as regional parameters in the installer, here's what localectl looks like:
[microlinux@linuxbox ~]$ localectl System Locale: LANG=fr_FR.UTF-8 VC Keymap: ch-fr X11 Layout: ch X11 Variant: fr
Now I'd like to have my system messages in english. So I set the system language accordingly:
$ sudo localectl set-locale LANG=en_US.utf8
Things seem to look OK now:
[microlinux@linuxbox ~]$ localectl System Locale: LANG=en_US.utf8 VC Keymap: ch-fr X11 Layout: ch X11 Variant: fr
Except when I display my LANG variable, it's still fr_FR.UTF-8 for normal users... but en_US.utf8 for root.
This looks like inconsistent or buggy behavior to me.
Any suggestions on how to change the default system locale LANG so that it's en_US.utf8 for everybody *without* having to jump through burning loops and putting it in everybody's ~/.bashrc ?
echo LANG=en_US.UTF-8 > /etc/locale.conf
-- Leon