Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Update mangled locale settings, recommendations?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
zaggynl
Posts: 5
Joined: 2022-06-28 14:37

Update mangled locale settings, recommendations?

#1 Post by zaggynl »

Hello, an unknown update appears to have mangled my locale settings, resulting in the below every time I run an apt command:

apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_TIME = "en_NL.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").
locale: Cannot set LC_ALL to default locale: No such file or directory

my /etc/apt/sources.list:
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free

What is the recommendation here, file a bug and set locale manually in a config file?
Or am I misunderstanding locales here.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Update mangled locale settings, recommendations?

#2 Post by Head_on_a_Stick »

Try

Code: Select all

# dpkg-reconfigure locales
If that doesn't work check /etc/default/locale for errors. That LANGUAGE line should be set to "en_US.UTF-8".

The Debian wiki has a Locale page with all this information.
deadbang

zaggynl
Posts: 5
Joined: 2022-06-28 14:37

Re: Update mangled locale settings, recommendations?

#3 Post by zaggynl »

Thanks for the reply!

Code: Select all

dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_TIME = "en_NL.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").
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_TIME = "en_NL.UTF-8",
LANG = "C"
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_US:en",
LC_ALL = (unset),
LC_TIME = "en_NL.UTF-8",
LANG = "C"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Code: Select all

cat /etc/default/locale
# File generated by update-locale
LANG=en_US.UTF-8
LANGUAGE="en_US:en"

edited /etc/default/locale to:
LANG=en_US.UTF-8
LANGUAGE="en_US.UTF-8"

errors persisted but differently:
apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US.UTF-8",
LC_ALL = (unset),
LC_TIME = "en_NL.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").
locale: Cannot set LC_ALL to default locale: No such file or directory

ok after:
/etc/default/locale
LANG=en_US.UTF-8
LANGUAGE="en_US.UTF-8"
LC_ALL=en_US.UTF-8

No idea what caused this or why

Code: Select all

dpkg-reconfigure locales
does not correct this.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Update mangled locale settings, recommendations?

#4 Post by Head_on_a_Stick »

Actually there shouldn't be a LANGUAGE line at all. My bullseye system only has LANG set explicitly and that's how Arch is configured as well.

LC_ALL should *not* be set so remove both that line and the LANGUAGE line.

Then make sure the en_US.UTF-8, en_NL,UTF-8 & any other desired locales are un-commented in /etc/locale.gen and run

Code: Select all

# locale-gen
Does that fix things without setting LC_ALL?
deadbang

zaggynl
Posts: 5
Joined: 2022-06-28 14:37

Re: Update mangled locale settings, recommendations?

#5 Post by zaggynl »

There doesn't appear to be an en_NL line in /etc/locale.gen at all.
Only en_US.UTF-8 UTF-8 is uncommented

Aki
Global Moderator
Global Moderator
Posts: 2823
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 69 times
Been thanked: 385 times

Re: Update mangled locale settings, recommendations?

#6 Post by Aki »

Hello,
The en_NL.UTF-8 locale seems not to be existent in Debian: could the issue be caused by it ?
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Update mangled locale settings, recommendations?

#7 Post by Head_on_a_Stick »

I only mentioned that locale because the OP had it listed for LC_TIME. I didn't think to check if it actually existed :mrgreen:
deadbang

zaggynl
Posts: 5
Joined: 2022-06-28 14:37

Re: Update mangled locale settings, recommendations?

#8 Post by zaggynl »

I'm connecting by ssh to Debian from an OpenSUSE host with locale LC_TIME=en_NL.UTF-8, could this cause these issues?

Aki
Global Moderator
Global Moderator
Posts: 2823
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 69 times
Been thanked: 385 times

Re: Update mangled locale settings, recommendations?

#9 Post by Aki »

Hello,
zaggynl wrote: 2022-07-01 06:26 I'm connecting by ssh to Debian from an OpenSUSE host with locale LC_TIME=en_NL.UTF-8, could this cause these issues?
A different locale between the two computers could be the cause.

What is the output of the following command in OpenSUSE host *and* in Debian computer accessed by ssh ?

Code: Select all

locale 
And, by the way, which is the operating system you said was updated (in the first post) ?

EDIT:
the Debian shell refuses LC_TIME="en_NL.UTF-8" (because it does not exists in Debian); for example, if you try to change the LC_TIME variable in a Debian shell using your locale "en_NL.UTF-8" you obtain an error:

Code: Select all

$ export LC_TIME="en_NL.UTF-8"
bash: warning: setlocale: LC_TIME: cannot change locale (en_NL.UTF-8): No such file or directory
If confirmed in your case, there are many solutions; for example, you can solve changing the time locale or you can use a custom sshd_config file in your OpenSuse host
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

zaggynl
Posts: 5
Joined: 2022-06-28 14:37

Re: Update mangled locale settings, recommendations?

#10 Post by zaggynl »

I was blaming Debian as I noticed the warning after updating it, on hindsight it may just be me connecting from OpenSUSE with an odd locale.

OpenSUSE host:

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_US.UTF-8"
LC_TIME=en_NL.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=


Debian host: (connected from above opensuse host to this one)
locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME=en_NL.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=

Debian host: (through console)
cat localeconsole.txt
LANG=en_US.UTF-8
LANGUAGE=en_US:en
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've learned something new, thanks!

Aki
Global Moderator
Global Moderator
Posts: 2823
Joined: 2014-07-20 18:12
Location: Europe
Has thanked: 69 times
Been thanked: 385 times

Re: Update mangled locale settings, recommendations?

#11 Post by Aki »

Hello,
Thanks for the confirmation.
⢀⣴⠾⠻⢶⣦⠀
⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system
⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org
⠈⠳⣄⠀

Post Reply