How to properly set a locale on endeavouros?

hey!
during the installation of endeavouros i made the mistake of setting everything to the en_us locale. this is a bad experience because of the am/pm nonsense and i want my c locale back.
i tried some changes.
locale.gen has:

en_US.UTF-8 UTF-8 #added by calamares
C.UTF-8 UTF-8 #added manually, is that good?

locale.conf:

LANG=en_US.UTF-8
LC_CTYPE=C.UTF-8
LC_NUMERIC=C.UTF-8
LC_TIME=C.UTF-8
LC_COLLATE=C.UTF-8
LC_MONETARY=C.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=C.UTF-8
LC_NAME=C.UTF-8
LC_ADDRESS=C.UTF-8
LC_TELEPHONE=C.UTF-8
LC_MEASUREMENT=C.UTF-8
LC_IDENTIFICATION=C.UTF-8

then i sudo locale-gen but i cannot get my c locale back. i’m sure i have the c locale since locale -a returns:

C
C.utf8
en_US.utf8
POSIX

even after a reboot locale still returns

LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

is endeavour overriding the locale somewhere or am i messing up? i don’t want to become american by prolonged exposure to their locale, pls help.
i’m on i3 but not the automatic install, i installed without a desktop and added i3 manually. my display manager is ly.

1 Like

C.UTF-8 UTF-8 is not right.

Use the same syntax what you should have in /etc/locale.gen, there should be your country and language acronyms too:

# /etc/local.gen (partially)
en_GB.UTF-8 UTF-8
en_US.UTF-8 UTF-8
#  etc.


# /etc/locale.conf (choose your location)
LANG=en_US.UTF-8

Then run

sudo locale-gen
1 Like

i specifically want to set C (or preferably, utf8 equivalent of C) on everything except LANG, not my country’s locale, but i can’t find a C locale in /etc/locale.gen so i added it.
that’s what confuses me, i followed the syntax but with C and it didn’t work.

I think if you select no locale in locale.gen and run locale-gen it will default to C.UTF-8, but I could be wrong. At least that is how the archiso tools build the ISO. There is a locale.conf file in /etc with one line:

LANG=C.UTF-8

Not sure but try on terminal

export LC_ALL=C
export LANG="your-setting"

Is something like this what you are aiming at?

that did not seem to work, leaving it empty just left it empty.
i tried putting

LANG=en_US.UTF-8
LC_CTYPE=C.UTF-8
LC_NUMERIC=C.UTF-8
LC_TIME=C.UTF-8
LC_COLLATE=C.UTF-8
LC_MONETARY=C.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=C.UTF-8
LC_NAME=C.UTF-8
LC_ADDRESS=C.UTF-8
LC_TELEPHONE=C.UTF-8
LC_MEASUREMENT=C.UTF-8
LC_IDENTIFICATION=C.UTF-8

in my locale.conf (using syntax from your LANG=C.UTF-8 example) and it worked if i sudo locale-gen and then source /etc/profile.d/locale.sh but the settings were reverted to all en_US after a reboot.

export LC_ALL=C.UTF-8; export LANG="en_US.UTF-8" is exactly what i’m looking for but when i set those settings in my locale.conf i lose them after a reboot and it’s back to en_US again.

Does it work if you write those two variables into /etc/locale.conf and regenerate?

Edit: sorry, looks like you did that already.

Locale settings can be tricky. Maybe man localectl could help? It says you may need to update initrd if using dracut.

now this is weird, localectl shows the new correct values while locale shows the old ones. the system uses the old ones (date shows with am/pm)
i guess i’ll try regenerating initrd then and see if that helps

i updated initrd with dracut and that did not help either.

I was having a very similar issue about a month ago when I did a new install of EOS on a new machine. I’ll try and look through my command history to see what it was that finally worked.

1 Like

I’m the mean time, not to be rude, but have you looked at the Arch wiki for locale?

yeah, i read it but i couldn’t figure it out. the closest i got is that unset LANG && source /etc/profile.d/locale.sh in the “2.3 make locale changes immediate” section helps temporarily, until reboot.

Just noticed this :point_up:. Missed it the first time. :rofl::rofl::rofl:

Yes, those aren’t permanent.

Okay, some of this may be a repeat of what you did before, so my apologies.

What’s the output of
localectl list-locales?
and
localectl status?

Is there any chance that you have a file ~/.local/locale.conf? If so, this could be causing a conflict. It’s not always there, so don’t be surprised if it’s not.

The interesting thing is that whatever you save to your /etc/locale.conf should be saved and not revert upon reboot.

@eznix is correct, if no locale is set, the system should revert to C.UTF-8

$ localectl list-locales
C.UTF-8
en_US.UTF-8
$ localectl status
System Locale: LANG=en_US.UTF-8
               LC_CTYPE=C.UTF-8
               LC_NUMERIC=C.UTF-8
               LC_TIME=C.UTF-8
               LC_COLLATE=C.UTF-8
               LC_MONETARY=C.UTF-8
               LC_PAPER=C.UTF-8
               LC_NAME=C.UTF-8
               LC_ADDRESS=C.UTF-8
               LC_TELEPHONE=C.UTF-8
               LC_MEASUREMENT=C.UTF-8
               LC_IDENTIFICATION=C.UTF-8
    VC Keymap: us
   X11 Layout: us

(despite this, the locale command shows en_US.UTF-8 on everything and that’s what the system also uses)
i don’t have a ~/.local/locale.conf

Thank you.

What about locale -a?

$ locale -a
C
C.utf8
en_US.utf8
POSIX
1 Like

Okay. Do you want to completely remove the en_US.UTF-8?

My understanding is that using C.UTF-8 only works with LC_ALL, but I do not fully understand why; so I cannot give a better explanation.

What about cat /etc/locale.conf and cat /etc/locale.gen and cat /etc/default/locale?