2

I'm running Manjaro Gnome and installed some updates with the package manager. Since then I keep getting these messages in the console:

manpath: can't set the locale; make sure $LC_* and $LANG are correct
(anon):12: character not in range
manpath: can't set the locale; make sure $LC_* and $LANG are correct

Running locale gives me this output:

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=en_US.UTF-8
LC_CTYPE=
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=

When I run sudo locale-gen I get an error message that files or directories do not exist

Generating locales...
  de_DE.UTF-8...failed to set locale!
[error] cannot open locale definition file `i18n_ctype': No such file or directory

when I comment out de_DE.UTF-8 UTF-8 in /etc/locale.gen (then the only not commented out line is en_US.UTF-8 UTF-8), I get:

Generating locales...
  en_US.UTF-8...failed to set locale!
[error] cannot open locale definition file `en_GB': No such file or directory

This is the content of /usr/share/i18n/locales:

de_DE                  translit_combining
en_US                  translit_compat
i18n                   translit_font
iso14651_t1            translit_fraction
iso14651_t1_common     translit_hangul
iso14651_t1_pinyin     translit_narrow
translit_circle        translit_neutral
translit_cjk_compat    translit_small
translit_cjk_variants  translit_wide

So it appears that the files en_GB and i18n_ctype are indeed missing (although I am not sure if they should be in this folder)

Also, if I go to the Settings -> Region and Language, I cannot change the Language (it says Unspecified [ANSI_X3.4-1968]. If I click on it, there is nothing to select in the Select Language pop-up.

I found online that the problem could be with glibc(and according to the history glibc was reinstalled during the update I ran [2020-08-11T18:49:33+0200] [ALPM] reinstalled glibc (2.31-5)). However, I do not know how to fix that. There is no reinstall button for glibc in the package manager, and I do not want to do any experiments where I could end up in a bigger mess.

Is there a way to reinstall/reset the language files?

Update

I use NoExtract in /etc/pacman.conf to save space on the hard drive, like described in the [Arch wiki] (https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks#Installing_only_content_in_required_languages)

NoExtract = usr/share/help/* !usr/share/help/en*
NoExtract = usr/share/gtk-doc/html/*
NoExtract = usr/share/locale/* usr/share/X11/locale/* usr/share/i18n/* opt/google/chrome/locales/*
NoExtract = !*locale*/en*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
NoExtract = !usr/share/*locales/en_US !usr/share/*locales/i18n !usr/share/*locales/iso*
NoExtract = !usr/share/*locales/trans*
NoExtract = !*locale*/de*/* !usr/share/i18n/charmaps/UTF-8.gz !usr/share/*locale*/locale.*
NoExtract = !usr/share/*locales/de_DE !usr/share/*locales/i18n !usr/share/*locales/iso*
NoExtract = !usr/share/*locales/trans*
NoExtract = usr/share/qt4/translations/*
NoExtract = usr/share/man/* !usr/share/man/man*
NoExtract = usr/share/vim/vim*/lang/*
NoExtract = usr/lib/libreoffice/help/en-US/*

I wonder if this is part of the problem, maybe when glibc was reinstalled some files were skipped.

4 Answers 4

2
  1. Edit /etc/locale.gen:

    Uncomment the line with your:

    locale en_US.UTF-8
    
  2. run sudo locale-gen

Credit: https://nanxiao.me/en/fix-locale-configuration-issue-on-arch-linux/

1
  • That line is already uncommented, the problem is that the en_GB and i18n_ctype get deleted and I guess en_US is depending on them.
    – jost21
    Feb 18, 2021 at 19:34
0

I found a solution now. I don't think this is the best way, but it seems to work for me.

I downloaded the glibc package and manually copied the missing files (en_GB and i18n_ctype) to /usr/share/i18n/locales/.

And then run sudo locale-gen

0

You can get back your /etc/locale.gen by re-installing the glibc package. This will generate a new file on installation.

0

In my case, the problem was caused by KDE Plasma Settings Manager - which configured the locale to not existing configuration.

During the Manjaro installation, I picked Finland/English there, because it was available. Why not? It resolves to fi_EN.UTF-8 which turns out to be at least a nonsense, since glibc does not contain such a combo.

You can list the glibc languages checking its package files like that:

pacman -Ql glibc | grep fi_

Which in my case showed those two:

glibc /usr/share/i18n/locales/fi_FI
glibc /usr/share/i18n/locales/fi_FI@euro

fi_FI is the proper one, not fi_EN neither fi_US. Shame on you, Plasma.

Replace the grep fi_ in the command above to find your language, like for Polish: grep pl_, German: grep de_ and so on.

Then compare it to the result of locale command call. In my case I needed to correct it by editing /etc/locale.gen. You can follow Manjaro's troubleshooting:

https://wiki.manjaro.org/index.php/Locale

Or rather, in the Holly Arch Wiki:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .