VERY broken locales

I did a fresh install and somehow any time i run yay now I get a bunch of “perl: warning: Please check that your locale settings: (insert) are supported and installed on your system”

I’ve searched and everyone says to run sudo locale-gen but it doesn’t do anything other than listing two locales that aren’t even set
Additionally, I don’t have an /etc/default/locale if its relevant

This is the full warning:

perl: warning: Please check that your locale settings:
        LANGUAGE = "en_GB",
        LC_ALL = (unset),
        LC_CTYPE = "en_US.UTF-8",
        LC_NUMERIC = (unset),
        LC_COLLATE = (unset),
        LC_TIME = (unset),
        LC_MESSAGES = (unset),
        LC_MONETARY = (unset),
        LC_ADDRESS = (unset),
        LC_IDENTIFICATION = (unset),
        LC_MEASUREMENT = (unset),
        LC_PAPER = (unset),
        LC_TELEPHONE = (unset),
        LC_NAME = (unset),
        LANG = "en_GB.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C")

This is my /etc/locale.conf:

LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8

And my /etc/locale.gen:

en_US.UTF-8 UTF-8

Running locale --all-locales gives me this:

locale --all-locales
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
C.utf8
POSIX
en_US.utf8

I have no idea how I messed up locales THIS bad, is there a way to just get them back without reinstalling?

Make sure en_GB.UTF-8 UTF-8 is also uncommented in /etc/locale.gen if you want to use it. Then generate the locales.

sudo locale-gen

You may need to reboot afterward. Then run locale to verify that the locales are set correctly.

trying to run locale, I just get this

the weird part is, I have no mention of en_GB anywhere in locale.gen or locale.conf
I made sure to wipe locale.gen so there are no hidden uncommented things

I suspect there’s some leftover somewhere in my home directory from previous installs or another file somewhere in root?

$ locale
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL=

Wait, so do you not want to use en_GB.UTF-8? It was set as the default language in your original post, that’s why I figured you would want to add that locale.

The installer sets some of that stuff up; is it possible you selected that as the language or keyboard layout when you were doing the original installation?

In a previous install yes, but I selected en_US during the installation this time around
I am fine with either, I’m just trying to stop Arch from exploding any time I install or launch a program, and en_US doesn’t seem to generate weird translation entries in the .desktop files KDE generates so I’m preferably trying to switch to it

Fixed!
It turns out it was KDE…
KDE stores locale settings separately in ~/.config/plasma-localerc, which is why I couldn’t figure out where on earth en_GB was coming from
I don’t seem to need the /etc/locale* files at all, since KDE appears to redefine the locale variables

1 Like

Looking forward to the day KDE/Qt apps stop putting config files all over the place. Especially the ones buried in 2–3 levels of directories, which wouldn’t be so bad if the main directory housed the rest of the files.

But no… there are like 5 directories in .config, then a random number of files in the same directory, and then there are more in .local/share. Chaotic. :face_with_spiral_eyes:

ehh, at least this time it was in ~/config xD

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.