Locale: Cannot set LC_ALL to default locale: No such file or directory

Which is the correct way to fix this error?

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

I’m using tumbleweed and set the language via Yast. I want to use English as my OS language but I’m leaving in Europe and I’d like to use EUR currency, and metric unit system.
The closest locale to my preferences is en_IE but when I try change it from the Details… menu I get this error.


But if I set LC_ALL with something like

$ export LC_ALL=C.UTF-8

I get this and all my settings are changed.

$ locale
LANG=en_US.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=C.UTF-8

How can I fine tune the locale?

The correct way to fix this error is to not use KDE System Settings to change locale. KDE should pick normal POSIX locale variables.

You could look into this directory, create the missing file using any present as template and it this works submit to yast-country.

The question is rather unclear. Your post talks about KDE, YaST and POSIX locale variables. Which part do you want to tune?

The correct way to fix this error is to not use KDE System Settings to change locale. KDE should pick normal POSIX locale variables.

Ok, I can reset the KDE locale to the default. But then? In Yast I can only select the language.

You could look into this directory, create the missing file using any present as template and it this works submit to yast-country.

Which directory? The error mention a generic directory.

The question is rather unclear. Your post talks about KDE, YaST and POSIX locale variables. Which part do you want to tune?

Sorry, maybe I was not clear enough.
I am getting locale related errors with commands like glxgears, inxi (related to Perl…) and I think it was misconfigured because of the error I posted above.
I was trying to configure the default locale using Yast to make sure it is done globally, but I probably didn’t understand where it acts.

In the KDE settings I changed some locales, for example the paper size from letter to A4.
So my idea was to use en_IE because the English language locale that uses the locales I want (english, euro, metric etc).

Anyway, your answer made me realize that probably my approach is wrong and I have no idea how to use the locales I want but avoid the errors in the console.

I talked about YaST error which shows the exact directory with languages that YaST can handle.

You get locale errors because KDE can generate much more locale combinations than are available in glibc, so programs that use glibc with POSIX locales cannot find locale name that KDE creates and exports.

Apparently this resulted in KDE picking this strange locale en_150. Quite possible that something like that actually exists … hmm, yes, it does - in CLDR it is territory code for the Europe :slight_smile:

This is long standing problem with KDE which does not mix well with non-KDE programs regarding locale support.

You may try generating POSIX locale with this name changing just paper size.

Apparently this resulted in KDE picking this strange locale en_150. Quite possible that something like that actually exists … hmm, yes, it does - in CLDR it is territory code for the Europe :slight_smile:

It looks like there is and English (Euro) en_150 :slight_smile:

image

This is long standing problem with KDE which does not mix well with non-KDE programs regarding locale support.

I changed both Yast and KDE to the default en_US, rebooted to be sure and now I have:

$ locale
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=

I do not have the warning even if LC_ALL is not set. Everything is in English but with US locale so for example in KDE time format is not in 24h, but if I change it via KDE settings is going to create the warning issue.

You may try generating POSIX locale with this name changing just paper size.

Something like this?

$ export LC_MONETARY="en_US.UTF-8@currency=EUR"

Sorry but probably I didn’t get your suggestion. I’m confused :pensive:

Following.

Also European but want to have my OS in English.

My workaround so far has been using the DK locale and setting currency to Euro, but everything seems an ugly hack at this point.

Trying to understand if there’s a clean way to get this to work without warnings, if that means staying away from KDE System Settings then so be it…

If the warnings are caused by a missing locale in /usr/lib/locale/, they only go away after installing that locale.

It is possible to create a custom locale, for example en_NL: see GitHub - PanderMusubi/locale-en-nl: 🇳🇱 English language locale for the Netherlands (en_NL). It has a lot of pointers to background info. I created an rpm based on that (glibc-i18ndata-en_NL on software.o.o).

Since PanderMusubi’s locale file itself is a text file (en_NL), it could perhaps serve as an example for other non-existing locales.

Oh, and if you want to ssh into a machine that lacks the locale you use at that moment, use e.g. LC_ALL=en_US.UTF-8 ssh ….

Kind regards,

Leen

GUI configuration can be confusing, command line is easy:

System Locale

erlangen:~ # cat /etc/locale.conf 
LANG=en_GB.UTF-8
erlangen:~ # 

User Locale

karl@erlangen:~> cat .config/plasma-localerc 
[Formats]
LANG=de_DE.UTF-8

[Translations]
LANGUAGE=en_GB:de
karl@erlangen:~>