Failed to set locale category LC_NUMERIC to en_RU

Currently I’ve just added export LC_ALL in my .bash_profile.

export LC_ALL=en_US.UTF-8
10 Likes

export LC_ALL doesn’t work for me, I got more warnings than before

+1: I got the same problem but with en_CH

2 Likes

You should use existing locale from /usr/share/locale/.

[pkropach@Pavels-MBP:~]$ ls -la /usr/share/locale | grep en_US
drwxr-xr-x    8 root  wheel   256 Sep 24  2018 en_US
drwxr-xr-x    8 root  wheel   256 Sep 24  2018 en_US.ISO8859-1
drwxr-xr-x    8 root  wheel   256 Sep 24  2018 en_US.ISO8859-15
drwxr-xr-x    8 root  wheel   256 Sep 24  2018 en_US.US-ASCII
drwxr-xr-x    8 root  wheel   256 Sep 24  2018 en_US.UTF-8
[pkropach@Pavels-MBP:~]$ locale
LANG=
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
1 Like

@pkropachev. So I did the following:

  1. touch ~/.bash_profile and with the text editor I wrote export LC_ALL=en_US.UTF-8 in the created bash_profile file created. It didn’t change the error message

  2. then I cd /usr/share/locale/ and typed ls -la /usr/share/locale | grep en_CH and then ls -la /usr/share/locale | grep en_CH and then locale which gave me the following output:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

The problem is still there, what shall I do?

1 Like

You should source dot file or restart terminal.

[pkropach@Pavels-MacBook-Pro:~]$ source ~/.bash_profile
OR
[pkropach@Pavels-MacBook-Pro:~]$ . ~/.bash_profile
2 Likes

Thank you for your answer @pkropachev. I tried both of your solution, but it unfortunately still doesn’t work

I just added this in my .bash_profile and there are no more errors.

export LC_ALL=en_US.UTF-8

16 Likes

GREAT!!! That solved the problem!!! many thanks @geoyws

@bjce
Strange that your previous actions didn’t solve problem.

@pkropachev: Indeed: re-reading your question, I don’t understand why it didn’t work previously. Thank you for your answer though

For some reason setting the locale by exporting it via .bash_profile didn’t seem to work, so I solved this by symlinking en_US.UTF-8 to en_DE.UTF-8

cd /usr/share/locale
sudo ln -sv  en_US.UTF-8  en_DE.UTF-8
1 Like

Solved my problem. Thanks.

Thank you! it solved my problem.

If you experience more WARNING like me, you could check the following:

First, “export LC_ALL=en_US.UTF-8” and “locale” to see if it works, then echo $SHELL, edit .bashrc or .zshrc(depending which shell you’re currently using), make sure to put “export LC_ALL=en_US.UTF-8” at the first line, restart your terminal.

3 Likes

I have zsh installed.
I’ve edited this file: ~/.zshrc
Added:
export LC_ALL=en_US.UTF-8

3 Likes

Yes, I my case I was getting the same error.

I am a MAC Book user, so adding export LC_ALL=en_US.UTF-8 to ~/.bash_profile solved my problem.

After that you have to run source ~/.bash_profile and that’s it.

2 Likes

If you are already using zsh, you might aswell use the proposed default from your ~/.zshrc and enable this line:

# You may need to manually set your language environment
export LANG=en_US.UTF-8

This will give you a cleanly configured locale setup:

 ~ locale
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
3 Likes

Thank you for the suggestion!

Thanks George, it worked.

1 Like