I want to change the localisation to en_US.utf8
so that all log messages from applications were displayed in english. This works when I prefix the command with LANG=en_US.utf ./my-command
, now every output of ./my-command
is english.
localectl
seems the right tool to make it permanent, so I tried
[root@cnx65 ~]# localectl set-locale LANG=en_US.utf8
But when now running ./my-command
, the output is still in german. According to localectl
, we have en_US.utf8
set:
[root@cnx65 ~]# localectl
System Locale: LANG=en_US.utf8
VC Keymap: de_alt_UTF-8
X11 Layout: us
where locale
and also the $LANG
variable shows still german:
[root@cnx65 ~]# locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LC_NAME="de_DE.UTF-8"
LC_ADDRESS="de_DE.UTF-8"
LC_TELEPHONE="de_DE.UTF-8"
LC_MEASUREMENT="de_DE.UTF-8"
LC_IDENTIFICATION="de_DE.UTF-8"
LC_ALL=
[root@cnx65 ~]# echo $LANG
de_DE.UTF-8
I also verified that the locale exists with localectl -a
:
[root@cnx65 ~]# locale -a | grep en_US.utf8
en_US.utf8
Why is this not working? It's not traceable for me. As you can see, all commands ran as root, so there couldn't be a permission issue.
I don't want to just set the LANG
environment variable somwhere globally like in /etc/profiles
since the server got provisioned by Ansible, so there's no interactive login shell.
0 Answers