Mkinitcpio, update-grub and inxi (among others) shows locale errors

A while ago I started getting errors stating my default locale is not correct in f ex update-grub, mkinitcpio and even inxi

inxi                                                                                                                                                                                                 ✔ 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.UTF-8",
        LC_ALL = (unset),
        LC_ADDRESS = "sv_SE.UTF-8",
        LC_COLLATE = "en_US.UTF-8",
        LC_CTYPE = "sv_SE.UTF-8",
        LC_IDENTIFICATION = "sv_SE.UTF-8",
        LC_MEASUREMENT = "sv_SE.UTF-8",
        LC_MESSAGES = "en_US.UTF-8",
        LC_MONETARY = "sv_SE.UTF-8",
        LC_NAME = "sv_SE.UTF-8",
        LC_NUMERIC = "sv_SE.UTF-8",
        LC_PAPER = "sv_SE.UTF-8",
        LC_TELEPHONE = "sv_SE.UTF-8",
        LC_TIME = "en_SE.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
CPU: 12-core AMD Ryzen 9 7900X (-MT MCP-) speed/min/max: 3488/3000/5733 MHz
Kernel: 6.1.31-2-MANJARO x86_64 Up: 4m Mem: 2170.1/31832.4 MiB (6.8%)
Storage: 4.09 TiB (36.8% used) Procs: 546 Shell: Zsh inxi: 3.3.27

This makes zero sense to me, it is falling back to one of the locales that it is stating does not work??

cat /etc/locale.gen | tail -4                                                                                                                                                                        ✔ 
# Locales enabled by Calamares
en_US.UTF-8 UTF-8
sv_SE.UTF-8 UTF-8
#en_SE.UTF-8 UTF-8
cat /etc/locale.conf                                                                                                                                                                          ✔  4s  
#LC_ALL=
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
#LC_COLLATE=C
LC_COLLATE=en_US.UTF-8
LC_CTYPE=sv_SE.UTF-8
#LC_MESSAGES=C
LC_MESSAGES=en_US.UTF-8
LC_NUMERIC=sv_SE.UTF-8
LC_TIME=sv_SE.UTF-8
LC_MONETARY=sv_SE.UTF-8
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8
cat ~/.config/plasma-localerc                                                                                                                                                                        ✔ 
[Formats]
LANG=en_US.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_MONETARY=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_NUMERIC=sv_SE.UTF-8
LC_PAPER=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_TIME=en_SE.UTF-8

[Translations]
#LANGUAGE=en_US ## I changed to the line below to se if that was the culprit, it was not.
LANGUAGE=en_US.UTF-8
sudo locale-gen                                                                                                                                                                              ✔  10s  
Generating locales...
  en_US.UTF-8... done
  sv_SE.UTF-8... done
Generation complete.
localectl                                                                                                                                                                                            ✔ 
System Locale: LANG=en_US.UTF-8
               LC_CTYPE=sv_SE.UTF-8
               LC_NUMERIC=sv_SE.UTF-8
               LC_TIME=sv_SE.UTF-8
               LC_MONETARY=sv_SE.UTF-8
               LC_PAPER=sv_SE.UTF-8
               LC_NAME=sv_SE.UTF-8
               LC_ADDRESS=sv_SE.UTF-8
               LC_TELEPHONE=sv_SE.UTF-8
               LC_MEASUREMENT=sv_SE.UTF-8
               LC_IDENTIFICATION=sv_SE.UTF-8
    VC Keymap: sv-latin1
   X11 Layout: se
locale -a                                                                                                                                                                                            ✔ 
C
C.UTF-8
en_US.utf8
POSIX
sv_SE.utf8

If I open up the Manjaro settings manager and go into locale settings, I can add en_SE.UTF-8 but It will not set anything in the detailed settings. When I press Apply, all settings to that locale just disappears.
So I opted to remove it completely and just use the “normal” locales until that works and THEN look into that. But maybe it’s connected?

I am so confused. I have been searching through forums for a week, reading arch and manjaro wikis and tutorials. I simply don’t understand why this suddenly broke.

Running mkinitcpio -P makes be a BIT nervous now…

Would this be of help? :arrow_down:

That was the first thing I did, about a week ago so sorry no, that does not help.

Everything referenced in that root tip is included in my initial post.

Please edit your topic title to be clear and concise about the issue you’re having. Please see How to Post.

You have probably seen this but, just in case:

https://wiki.archlinux.org/title/locale#Setting_the_system_locale

Yeah, I now even removed the commented out lines just to be sure LANG is the first, but no change, same errors.

I even tried the method mentioned on the wiki:

localectl set-locale LANG=en_US.UTF-8

inxi                                                                                                                                                                                                 ✔ 
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US.UTF-8",
        LC_ALL = (unset),
        LC_ADDRESS = "sv_SE.UTF-8",
        LC_COLLATE = "en_US.UTF-8",
        LC_CTYPE = "sv_SE.UTF-8",
        LC_IDENTIFICATION = "sv_SE.UTF-8",
        LC_MEASUREMENT = "sv_SE.UTF-8",
        LC_MESSAGES = "en_US.UTF-8",
        LC_MONETARY = "sv_SE.UTF-8",
        LC_NAME = "sv_SE.UTF-8",
        LC_NUMERIC = "sv_SE.UTF-8",
        LC_PAPER = "sv_SE.UTF-8",
        LC_TELEPHONE = "sv_SE.UTF-8",
        LC_TIME = "en_SE.UTF-8",
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
CPU: 12-core AMD Ryzen 9 7900X (-MT MCP-) speed/min/max: 3329/3000/5733 MHz
Kernel: 6.1.31-2-MANJARO x86_64 Up: 1h 48m Mem: 3558.3/31832.4 MiB (11.2%)
Storage: 4.09 TiB (36.8% used) Procs: 425 Shell: Zsh inxi: 3.3.27

Notice how LANG is the last thing listed in the error but always at top in all configs.
It also looks like there is something missing before the “are supported and installed on your system.” like the locales should be listed or something?

Edit. update-grub no longer produces warnings, I saw that now that my manjaro-keyring got updated.

Edit2. sudo mkinitcpio -P produces these, not sure if they are errors or warnings, or none.

sudo mkinitcpio -P                                                                                                                                                                                   ✔ 
==> Building image from preset: /etc/mkinitcpio.d/linux515.preset: 'default'
  -> -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64.img --microcode /boot/amd-ucode.img
==> Starting build: '5.15.114-2-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [resume]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-5.15-x86_64.img'
bsdtar: Failed to set default locale
bsdtar: Failed to set default locale
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux515.preset: 'fallback'
  -> -k /boot/vmlinuz-5.15-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-5.15-x86_64-fallback.img -S autodetect --microcode /boot/amd-ucode.img
==> Starting build: '5.15.114-2-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [resume]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-5.15-x86_64-fallback.img'
bsdtar: Failed to set default locale
bsdtar: Failed to set default locale
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux61.preset: 'default'
  -> -k /boot/vmlinuz-6.1-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.1-x86_64.img --microcode /boot/amd-ucode.img
==> Starting build: '6.1.31-2-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [resume]
  -> Running build hook: [autodetect]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-6.1-x86_64.img'
bsdtar: Failed to set default locale
bsdtar: Failed to set default locale
==> Image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux61.preset: 'fallback'
  -> -k /boot/vmlinuz-6.1-x86_64 -c /etc/mkinitcpio.conf -g /boot/initramfs-6.1-x86_64-fallback.img -S autodetect --microcode /boot/amd-ucode.img
==> Starting build: '6.1.31-2-MANJARO'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [resume]
  -> Running build hook: [modconf]
  -> Running build hook: [block]
==> WARNING: Possibly missing firmware for module: 'aic94xx'
==> WARNING: Possibly missing firmware for module: 'bfa'
==> WARNING: Possibly missing firmware for module: 'qed'
==> WARNING: Possibly missing firmware for module: 'qla1280'
==> WARNING: Possibly missing firmware for module: 'qla2xxx'
==> WARNING: Possibly missing firmware for module: 'wd719x'
==> WARNING: Possibly missing firmware for module: 'xhci_pci'
  -> Running build hook: [keyboard]
  -> Running build hook: [keymap]
  -> Running build hook: [consolefont]
==> WARNING: consolefont: no font found in configuration
  -> Running build hook: [plymouth]
  -> Running build hook: [filesystems]
==> Generating module dependencies
==> Creating gzip-compressed initcpio image: '/boot/initramfs-6.1-x86_64-fallback.img'
bsdtar: Failed to set default locale
bsdtar: Failed to set default locale
==> Image generation successful

They are successful and I can reboot, but still??

Hi @bedna ,

I have the same issue and I found that the problem was in the following directory:

/var/lib/AccountsService/users/$USER
[User]
Language=your_locale

You can read the whole post in the following post:
Display manager - ArchWiki

Hope it help,
Regards

Yeah, I read about that one too, but I don’t have anything in that directory so it didn’t affect me.

BUT I finally figured it out.

I removed /etc/locale.conf and ~/.config/plasma-localerc and rebooted.

Came back to a login screen in Swedish, witch is VERY odd since I choose English when I installed Manjaro. Turned out it was only the time that had stuck to Swedish (witch made me think the whole os was in swedish).

It also made zsh freak out just showing me a ~ but I knew since before playing around with this, I just have to add [Translations] LANGUAGE=en_US at the end of ~/.config/plasma-localerc (a new file is created ONLY containing LANG=en_US.UTF-8 after reboot)

I then right clicked on Manjaro settings manager and clicked Language packages. Then from there you can click All settings and then open Locale Settings (feels like I’m on windows here with multiple “control panels” xD) and in there click Detailed settings and set everything from there and then Apply.

This creates or at least edits (didn’t check if the file already existed) /etc/locale.conf but only adds the swedish settings ie:

LANG=en_US.UTF-8
LC_NUMERIC=sv_SE.UTF-8
LC_MONETARY=sv_SE.UTF-8
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION=sv_SE.UTF-8

I then ran inxi and got no errors.

I then opened System Settings > Regional settings > Regional Language: and changed what needed to be changed to swedish but made SURE I choose swedish/swedish not swedish/english.
I remember having trouble with this since I want meassurements etc in swedish, incl dateformat and that is why I needed the swedish/english version. Instead I opted to use en_US on time and manually edit the output on the task manager and change to 24h.

I checked ~/.config/plasma-localerc and yepp, same thing, only adding the swedish settings, leaving out LC_TIME (since its the same as LANG)

So that was it, I can NOT have anything except LANG set to en_US.UTF-8 then I get those errors. That is the case with locale.conf at least, I did not try with plasma-localerc.

The odd thing is this was working for months before, maybe the en_SE somehow worked before but broke.
I did notice some settings in the KDE plasma settings it did not finding swe/eng for all settings, but some had.

I also always get this error when changing there, but it works now so I decide to put my head in the sand and hope it won’t break again; knocks on wood

inxi                                                                                                                                                                                             INT ✘ 
CPU: 12-core AMD Ryzen 9 7900X (-MT MCP-) speed/min/max: 3338/3000/5733 MHz
Kernel: 6.1.31-2-MANJARO x86_64 Up: 41m Mem: 3046.6/31832.4 MiB (9.6%)
Storage: 4.09 TiB (36.8% used) Procs: 421 Shell: Zsh inxi: 3.3.27

A satisfied but very tierd Bedna signing out.

1 Like

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