You are not logged in.

#1 2025-04-25 21:19:34

black_dragon
Member
Registered: 2025-04-18
Posts: 27

[SOLVED] Can't set locale

Hi,
I'm trying to set en_US-UTF-8 locale but every time after reboot, I still have C.UTF-8,
Steps:
1) Uncomment en_US-UTF-8 in /etc/locale.gen
2) Call locale-gen
3) Set /etc/locale.conf to

LANG=en_US.UTF-8

But after reboot, here's the result of locale command:

LANG=C.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="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"
LC_ALL=

In the same time, output of localectl:

System Locale: LANG=en_US.UTF-8
    VC Keymap: us
   X11 Layout: us
    X11 Model: pc105+inet
  X11 Options: terminate:ctrl_alt_bksp

If I, instead of reboot, call source /etc/profile.d/locale.sh, I will get the desired result:

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=

Though after reboot I have C.UTF-8 everywhere.

Why is this happenning? Did I miss something? Is it something wrong with my init scripts?

Last edited by black_dragon (2025-04-26 00:31:30)

Offline

#2 2025-04-25 22:10:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,317

Re: [SOLVED] Can't set locale

Your session script, desktop session or shell rc will likely steamroll C.UTF-8 after /etc/profile.d/locale.sh has initially been sourced.
https://wiki.archlinux.org/title/KDE#Pl … e_settings is otr for that kind of stuff, but it could happen in any context.

Try to boot the multi-user.target (2nd link below) and login on the console.
Then check locale.
You can eg "bash -x -l" to trace a login shell.

Offline

#3 2025-04-26 00:31:02

black_dragon
Member
Registered: 2025-04-18
Posts: 27

Re: [SOLVED] Can't set locale

Thanks!
The problem was indeed in ~/.config/plasma-localerc, it was setting C.UTF-8 for some reason. After I deleted it and logged again, the new and proper file was generated.

Offline

#4 2025-04-26 00:32:11

mackin_cheese
Member
Registered: 2025-01-07
Posts: 477

Re: [SOLVED] Can't set locale

This is also documented in the troubleshooting section for the locale page in the arch wiki, please remember to do research first before asking questions.

Offline

Board footer

Powered by FluxBB