You are not logged in.

#1 2023-07-14 14:18:48

FenrisLycaon
Member
From: India
Registered: 2021-05-04
Posts: 8
Website

Error while working with locales.

I am getting this error message after every update

bsdtar: Failed to set default localebsdtar: Failed to set default locale

And I am not able to work with locales as I get this message quite frequently.

Failed to set default locale

I tried regenerating the locales, it won't work.

Offline

#2 2023-07-14 14:25:34

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: Error while working with locales.

Please post the output of each of the following:

grep -v '^#' /etc/locale.gen
cat /etc/locale.conf
localectl
env | grep '\(LANG\|LC\)'

"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2023-07-14 14:34:27

FenrisLycaon
Member
From: India
Registered: 2021-05-04
Posts: 8
Website

Re: Error while working with locales.

Here it is :

en_US.UTF-8 UTF-8
# This is the fallback locale configuration provided by systemd.

LANG="C.UTF-8"
System Locale: LANG=C.UTF-8
VC Keymap: (unset)
X11 Layout: (unset)
LANG=en_US.UTF-8
LANGUAGE=
LC_MEASUREMENT=en_IN.UTF-8
LC_MONETARY=en_IN.UTF-8
LC_TIME=en_US.UTF-8

Offline

#4 2023-07-14 14:41:00

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: Error while working with locales.

Ah, yeah, every single one of those is problematic.  How did you install this system (which instructions did you follow)?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2023-07-14 14:57:28

FenrisLycaon
Member
From: India
Registered: 2021-05-04
Posts: 8
Website

Re: Error while working with locales.

I installed it normally using the command line and by reading the arch wiki. The thing is I saw a locales directory hogging up space and removed it.

Little did I know it would break my system. I thought it contains the locales that I am not using so I can get some space out of it. I have a rather old system and was running out of storage.

Anyways, how do I fix this ? Please don't say I need to reinstall.

Offline

#6 2023-07-14 15:04:30

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: Error while working with locales.

Which "locales directory" did you remove?  All of /usr/share/locale??  You can remove some of those (and put them in NoExtract in pacman.conf) but you need the ones you are using.  However, if you didn't set them to NoExtract, they'd be replaced on the next update (and may have been already).

In any case, the absence of the locales data is just yet another problem - but all the outputs from your previous post show that your own locale configuration is just completely gibberish even aside from any missing files.  Work carefully through the entire locales section of the installation guide:
https://wiki.archlinux.org/title/Instal … calization


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2023-07-14 15:28:57

FenrisLycaon
Member
From: India
Registered: 2021-05-04
Posts: 8
Website

Re: Error while working with locales.

I don't remember. This was months ago. I was busy with work on the office laptop and was using this one mainly as a backup/server.

I have changed the configs. Please help me through it.

en_US.UTF-8 UTF-8
# This is the fallback locale configuration provided by systemd.

LANG="en_US.UTF-8"
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: (unset)
LANG=en_US.UTF-8
LANGUAGE=
LC_MEASUREMENT=en_IN.UTF-8
LC_MONETARY=en_IN.UTF-8
LC_TIME=en_US.UTF-8

Edit: 2nd output

Last edited by FenrisLycaon (2023-07-14 15:29:29)

Offline

#8 2023-07-14 15:40:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: Error while working with locales.

1A. I don't know if this is still absolutely necessary (it used to be) but not having a ISO-8859 locale is a bad idea.  My locale.gen

$ grep -v '^#' /etc/locale.gen
en_US ISO-8859-1
en_US.UTF-8 UTF-8

1B. You *definitely* need to uncomment every locale in locale.gen that you intend to use.  As you are using en_IN.UTF-8, you need to have that in locale.gen (then rerun locale-gen after edits to locale.gen).

2. I don't know why your locale.conf says it's provided by systemd... did you use some tool to generate that file?  That's not what is instructed in the wiki page I linked too.  But you did get rid of the nonsensical "C.UTF-8" ... that's just not a real thing (EDIT: in sane libcs at least, but perhaps in insane ones starting last year).  So locale.conf seems fine.

3. Localectl output also looks okay now (if you intend to use en_US and not en_IN).

4. Along with 1B, you cant set these variables to locales you have not generated.  So either generate en_IN.UTF-8 or change the settings for LC_MEASUREMENT and LC_MONETARY.  I'm not sure what tools use LANGUAGE - that's probably not relevant here, but it seems odd to set it to an empty string.

Last edited by Trilby (2023-07-14 19:33:38)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#9 2023-07-14 18:40:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,129

Re: Error while working with locales.

https://wiki.archlinux.org/title/Locale - C.UTF-8 is actually a real thing since glibc 2.35 roll

Offline

#10 2023-07-14 23:21:10

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,727

Re: Error while working with locales.

It's also built-in now, so you don't have to mess with it. ISO-8859 locales haven't been needed in a very long time, either.

Offline

#11 2023-07-15 09:17:56

nl6720
The Evil Wiki Admin
Registered: 2016-07-02
Posts: 714

Re: Error while working with locales.

Trilby wrote:

I don't know why your locale.conf says it's provided by systemd... did you use some tool to generate that file?  That's not what is instructed in the wiki page I linked too.

If you don't create a /etc/locale.conf file yourself, systemd‐tmpfiles‐setup.service, following the instructions of /usr/lib/tmpfiles.d/arch.conf, will copy /usr/share/factory/etc/locale.conf to /etc/locale.conf.


Trilby wrote:

I'm not sure what tools use LANGUAGE - that's probably not relevant here, but it seems odd to set it to an empty string.

Perhaps they are using KDE? Plasma has a stupid habit of exporting an empty LANGUAGE.

Last edited by nl6720 (2023-07-15 09:20:32)

Offline

#12 2023-07-19 14:40:22

FenrisLycaon
Member
From: India
Registered: 2021-05-04
Posts: 8
Website

Re: Error while working with locales.

Yes, I am using KDE.

Also, the bsdtar error is not there anymore.

As for the outputs,

en_US.UTF-8 UTF-8
LANG="en_US.UTF-8"
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: (unset)
LANG=en_US.UTF-8
LANGUAGE=
LC_MEASUREMENT=en_IN.UTF-8
LC_MONETARY=en_IN.UTF-8
LC_TIME=en_US.UTF-8

Do I need to worry about these ?

Offline

#13 2023-07-19 15:39:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,466
Website

Re: Error while working with locales.

Trilby wrote:

You *definitely* need to uncomment every locale in locale.gen that you intend to use... So either generate en_IN.UTF-8 or change the settings for LC_MEASUREMENT and LC_MONETARY.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB