Perl warnings about locale

So, I’ve been using EndeavourOS since Decembre 2021, and for quite a while I’ve been seeing warnings about my locale. I had to install my system again because I recently broke it, and I had seen the obligatory warnings again.

  [$] sudo pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 endeavouros is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Package (1)            Old Version  New Version  Net Change

extra/accountsservice  22.07.5-1    22.08.8-1      0.02 MiB

Total Installed Size:  0.97 MiB
Net Upgrade Size:      0.02 MiB

:: Proceed with installation? [Y/n] y
(1/1) checking keys in keyring                                     [-------------------------------------] 100%
(1/1) checking package integrity                                   [-------------------------------------] 100%
(1/1) loading package files                                        [-------------------------------------] 100%
(1/1) checking for file conflicts                                  [-------------------------------------] 100%
:: Processing package changes...
(1/1) upgrading accountsservice                                    [-------------------------------------] 100%
:: Running post-transaction hooks...
(1/4) Reloading system manager configuration...
(2/4) Arming ConditionNeedsUpdate...
(3/4) Reloading system bus configuration...
(4/4) Checking which packages need to be rebuilt
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_GB:de",
        LC_ALL = (unset),
        LC_ADDRESS = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LC_MONETARY = "Default.UTF-8",
        LC_PAPER = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
perl: warning: Setting locale failed.
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_MEASUREMENT = "Default.UTF-8",
        LC_TIME = "Default.UTF-8",
perl: warning: Please check that your locale settings:
        LC_NUMERIC = "Default.UTF-8",
        LANG = "Default.UTF-8"
        LANGUAGE = "en_GB:de",
    are supported and installed on your system.
        LC_ALL = (unset),
        LC_ADDRESS = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LC_MONETARY = "Default.UTF-8",
perl: warning: Falling back to the standard locale ("C").
        LC_PAPER = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_MEASUREMENT = "Default.UTF-8",
        LC_TIME = "Default.UTF-8",
        LC_NUMERIC = "Default.UTF-8",
        LANG = "Default.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_GB:de",
        LC_ALL = (unset),
        LC_ADDRESS = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LC_MONETARY = "Default.UTF-8",
        LC_PAPER = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_MEASUREMENT = "Default.UTF-8",
        LC_TIME = "Default.UTF-8",
        LC_NUMERIC = "Default.UTF-8",
        LANG = "Default.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Since this was a fresh install, I decided to investigate this time and tried to fix this.

  [$] locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
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=Default.UTF-8
LC_CTYPE="Default.UTF-8"
LC_NUMERIC=Default.UTF-8
LC_TIME=Default.UTF-8
LC_COLLATE="Default.UTF-8"
LC_MONETARY=Default.UTF-8
LC_MESSAGES="Default.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=Default.UTF-8
LC_IDENTIFICATION=de_DE.UTF-8
LC_ALL=

There are two potential ways I could find online to fix this, and one I figured out on my own - however, none of them worked.
The first I attempted was this:

  [$] sudo localectl set-locale LC_ALL=Default.UTF-8
Failed to issue method call: Locale assignment LC_ALL=Default.UTF-8 not valid, refusing.

This did not work at all. The same output (“assignment not valid, refusing”) is something I’ve seen with many varations, trying different locales and different locale settings, and even different writing styles because locale -a displayed the locales written differently.

  [$] locale -a
locale: Cannot set LC_CTYPE to default locale: No such file or directory
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
POSIX
de_DE.utf8
en_GB.utf8
en_US.utf8

However, I always received the same output and nothing changed.

Another way I found was was with sudo update-locale, but I’ll just get the output that update-locale command was not found.

The next thing I tried was kate /etc/default/locale. I could easily change the settings there, but, if you know better than I do what I was doing, you can probably already tell that this did not work out all either. It didn’t seem to break my system, at least, lol

Please advise.

This is wrong. There is no locale called “Default.UTF-8”.

That seems like a ubuntu command :thinking:

Comment out these in /etc/locale.gen as root and run sudo locale-gen. Also what is the output of cat /etc/locale.conf?

Yeah, I had this problem, too. Just run

sudo locale-gen

and that should fix it. Do not change any files manually.

There is no such thing.

My guess is that you use KDE and have used the KDE settings manager to set the locales.

For some pecualiar reason - the KDE settings manager creates a mess of the locale.conf with non-existing locales.

You will need to use the correct identificators.

LANG is the language used for system e.g. en_US.UTF-8 for US english or de_DE.UTF-8 for german.

The rest should be set fo use e.g. de_DE.UTF-8

Calamares add the chosen locale at install time by appending to /etc/locale.conf.

Verify no duplicates as the locale-gen script will process everything - even duplicates.

While this is a common known mistake, my guess is that OP has just used the wrong advice (tutorials, wikis, articles, aimed at *buntus) to configure/repair his Arch-based system. :wink:
*buntus use /etc/default/ to setup locale stuff, using totally different methods, IIRC.

I was stunned by the Default.UTF-8

2 Likes

I guess this is a KDE thing, then. Took this from KDE format settings.

Okay, so, I have been very big brain about this. After a complete fresh install (unrelated to the locale problem), I just did sudo locale-gen, and that appeared to have fixed everything - shortly before I broke things again, lol. What I did after generating the locale was going back to the KDE settings and set locales to Default.UTF-8, and just putting things back to, say de_DE.UTF-8 and generating the locale again doesn’t fix it. GG.

So, I am not sure what commenting out the locales in /etc/locale.gen is supposed to do, to be honest; it seems to have no effect. At least not after I fucked with the KDE settings again. On locale.conf, the situation right now is this:

$ cat --number "/etc/locale.conf"
     1  LANG=en_GB.UTF-8
     2  LC_ADDRESS=de_DE.UTF-8
     3  LC_IDENTIFICATION=de_DE.UTF-8
     4  LC_MEASUREMENT=de_DE.UTF-8
     5  LC_MONETARY=de_DE.UTF-8
     6  LC_NAME=de_DE.UTF-8
     7  LC_NUMERIC=de_DE.UTF-8
     8  LC_PAPER=de_DE.UTF-8
     9  LC_TELEPHONE=de_DE.UTF-8
    10  LC_TIME=de_DE.UTF-8

UPDATE: Should’ve tried more things before posting, lol
Commenting out the locales in /etc/locale.gen does not seem to help with the situation at all. Having them commented out was what prevented me from fixing the damage I had redone with the KDE settings. And on that note:

locale -a shows all non-commented locales that are found in the file, so there are no duplicates.

Maybe there is some confusion from the language barrier.

  • System installs/generates the enabled (uncommented) locales in /etc/locale.gen, so they are available to the system and user sessions. You need to enable all possible locales your users may need. For example, a user wants GUI apps in German and another in French, so you enable both German and French in locale.gen. After each related package update, the system re-generates these.
  • In a user session (KDE, Gnome, BSPWM, etc), the default locale is the system locale (set in /etc/locale.conf).
  • In a user/DE session, you can configure different locale than default/system one, using a DE/session dependent method.
  • KDE/Plasma has a GUI (System Settings) to change user session locale, if used. This edits a file ($HOME/.config/plasma-localerc) with those settings (LANG and LANGUAGE env vars).
  • Archlinux does not use /etc/default/locale file for system settings, but because *buntus do, some programs include this file in their testing targets to find the appropriate locale to use. You should generally don’t have that file and don’t create it yourself, unless a package creates it.
  • Since, as you have realised, the locale configuration is somewhat complicated, you should read Archwiki to gain more and more accurate knowledge for this issue.

It is as easy as reading English. If you still can’t figure out how to correct your configuration, give more specific details on what you have done, what’s in the related files and what error messages you get from which apps, and relate all to Archwiki advice, so we are all on the same page. :man_shrugging:

I’m not sure what exactly I would have not understood, I think I was just a bit too vague on my update, lol - most notably, I have been rather unclear on indeed having finally fixed it.

The solution was primarily just sudo locale-gen, really. Well, after a fresh install anyway. The second important factor appears to have been that I should not select any locale from the KDE settings that, uhh … “don’t exist”?

Setting locales in the KDE settings that actually “do exist” - or at the very least are to be found in /etc/locale.gen (in this case I picked C) -, and then running sudo locale-gen seems to have solved the problem entirely. :slight_smile:

I guess I also forgot to say “thanks”, lol

1 Like

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