Cannot set locale persistent

I have trouble changing the default locale on both openSUSE 15.2 and 15.3


srvtest:~ # locale
LANG=POSIX
LC_CTYPE=en_DK.UTF-8
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=

My local.conf content:


LANG=en_DK.UTF-8
LANGUAGE=en_DK:en
LC_CTYPE=en_DK.UTF-8
LC_NUMERIC=en_DK.UTF-8
LC_TIME=en_DK.UTF-8
LC_COLLATE=en_DK.UTF-8
LC_MONETARY=en_DK.UTF-8
LC_MESSAGES=en_DK.UTF-8
LC_PAPER=en_DK.UTF-8
LC_NAME=en_DK.UTF-8
LC_ADDRESS=en_DK.UTF-8
LC_TELEPHONE=en_DK.UTF-8
LC_MEASUREMENT=en_DK.UTF-8
LC_IDENTIFICATION=en_DK.UTF-8
LC_ALL=en_DK.UTF-8

I don’t have anything in my /root/.profile

I am able to change all locale variable but “LC_ALL” with “localectl set-locale …” from console in current session.

But if I call

localectl set-locale LC_ALL=en_DK.UTF-8

I get this error:

Failed to issue method call: Locale assignment LC_ALL=en_DK.UTF-8 not valid, refusing.

I assume if I set “LC_ALL” I don’t have to set all the other variables, I also tried that in the .conf file but all variable, except LC-CTYPE, seems to be locked to “POSIX” (one might even expect it to be hard-coded?)

@MrBW:

It seems that, you’re located on the part of Europe west of the Kattegat. My (persistent) Locale looks like this –


 > 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=
 > 

On this machine, the system’s Locale is setup by –


 > cat /etc/locale.conf 
LANG=de_DE.UTF-8
 > 
 > cat /etc/vconsole.conf 
KEYMAP=de-latin1-nodeadkeys
FONT=suse12x22.psfu
FONT_MAP=
FONT_UNIMAP=
 > 

Please note that, “LC_ALL” is simply a concatenation of all the “LC_*” categories – please refer to the “locale.conf” man (5) page –

Note that LC_ALL may not be configured in this file.

You’ll possibly be best served by simply setting the LANG variable to “en_DK.utf8” –


 > ls -d /usr/lib/locale/*DK*
/usr/lib/locale/da_DK  /usr/lib/locale/da_DK.utf8  /usr/lib/locale/en_DK  /usr/lib/locale/en_DK.utf8
 > 

File /etc/sysconfig/language, variable ROOT_USES_LANG.

Thank you arvidjaar, that’s exactly what I was looking for :slight_smile:

At first view I find it criticisable that this file “still” exist. It seem to be leftovers from old days.
Found this note on SUSE’s site

KIS!