You are not logged in.

#1 2017-10-21 16:29:08

saurabhlambe
Member
Registered: 2017-08-21
Posts: 12

[SOLVED] Facing issues with locale

I didn't correctly install the locale while installing Arch. Now I'm facing constant issues whenever I open the terminal.

bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)

I have uncommented the following entry in /etc/locale.gen:

LANG=en_US.UTF-8 UTF-8

Output of the

locale

command:

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_IN.US-ASCII
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=en_US.UTF-8

In need of some urgent help. I tried DuckDuckGo for solutions, but I found no success.

Last edited by saurabhlambe (2017-10-21 17:27:28)

Offline

#2 2017-10-21 16:31:27

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Facing issues with locale

Did you remember to run...

locale-gen

after editing locale.gen?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2017-10-21 16:31:44

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Facing issues with locale

What is the output of

locale -a

Offline

#4 2017-10-21 16:34:55

saurabhlambe
Member
Registered: 2017-08-21
Posts: 12

Re: [SOLVED] Facing issues with locale

I did run

locale-gen

Sharing outputs.

[saurabh@saurabh ~]$ locale-gen
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Generating locales...
  LANG=en_US.UTF-8...cannot open locale definition file `LANG=en_US': No such file or directory

Output for locale -a:

saurabh@saurabh ~]$ locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX

Offline

#5 2017-10-21 16:37:10

saurabhlambe
Member
Registered: 2017-08-21
Posts: 12

Re: [SOLVED] Facing issues with locale

FYI:

I run this command to remove the locale after some googling and tried to re-install the locale.

sudo rm /usr/share/i18n/locales/en_US

Offline

#6 2017-10-21 16:37:37

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

Re: [SOLVED] Facing issues with locale

The entry in locale.gen was NOT "LANG=en_US.UTF-8 UTF-8". You're confusing locale.conf and locale.gen. You were only supposed to uncomment things in locale.gen, not add.

Offline

#7 2017-10-21 16:39:56

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Facing issues with locale

Why do you have the line

LANG=en_US.UTF-8 UTF-8

in /etc/locale.gen

What is the contents of /etc/locale.conf.
What guide are you following?
Edit:
added  in /etc/locale.gen to clarify

Last edited by loqs (2017-10-21 16:43:58)

Offline

#8 2017-10-21 16:42:35

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Facing issues with locale

saurabhlambe wrote:

I run this command to remove the locale after some googling and tried to re-install the locale.

sudo rm /usr/share/i18n/locales/en_US

Reinstall glibc to fix the damage caused by deleteing /usr/share/i18n/locales/en_US

Offline

#9 2017-10-21 17:00:40

saurabhlambe
Member
Registered: 2017-08-21
Posts: 12

Re: [SOLVED] Facing issues with locale

Thanks a lot @loqs.

Edited the /etc/locale.gen file and deleted "LANG" from the entry. And run "locale-gen". Seems to be working fine now.

loqs wrote:

Why do you have the line

LANG=en_US.UTF-8 UTF-8

in /etc/locale.gen

What is the contents of /etc/locale.conf.
What guide are you following?
Edit:
added  in /etc/locale.gen to clarify

Last edited by saurabhlambe (2017-10-21 17:05:34)

Offline

#10 2017-10-21 17:07:41

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Facing issues with locale

I suspect there is still an issue as the output of locale produced

LANG=en_IN.US-ASCII
....
LC_ALL=en_US.UTF-8

Is that LANG setting valid?  Why is it being overruled by LC_ALL?

Last edited by loqs (2017-10-21 17:07:58)

Offline

#11 2017-10-21 17:13:16

saurabhlambe
Member
Registered: 2017-08-21
Posts: 12

Re: [SOLVED] Facing issues with locale

I'm sorry I didn't get you.

I'll share an output though.

[saurabh@saurabh firefox]$ locale
LANG=en_IN.US-ASCII
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=en_US.UTF-8

Offline

#12 2017-10-21 17:18:36

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Facing issues with locale

What is the contents of /etc/locale.conf?

Offline

#13 2017-10-21 17:20:33

saurabhlambe
Member
Registered: 2017-08-21
Posts: 12

Re: [SOLVED] Facing issues with locale

"/etc/locale.conf" doesn't exist hmm

Offline

#14 2017-10-21 17:35:47

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: [SOLVED] Facing issues with locale

Installation_guide#Locale
Also find out where LANG=en_IN.US-ASCII and LC_ALL=en_US.UTF-8 is being set.

Offline

#15 2017-10-21 23:31:28

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [SOLVED] Facing issues with locale

You almost certainly want LC_COLLATE to be 'C' and not language/region specific.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB