LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   locale: Cannot Set LC_ALL to default locale: No such file or directory. (http://www.linuxquestions.org/questions/linux-general-1/locale-cannot-set-lc_all-to-default-locale-no-such-file-or-directory-218622/)

asym 08-17-2004 01:28 AM

locale: Cannot Set LC_ALL to default locale: No such file or directory.
 
Hi mates when i open up the console terminal i'm getting the following error:

locale: Cannot Set LC_ALL to default locale: No such file or directory.

I have tried using the command "locale" and as output i got the following:

[root@localhost root]# locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US
LC_CTYPE=en_US
LC_NUMERIC=mt_MT
LC_TIME=en_US
LC_COLLATE=en_US
LC_MONETARY=mt_MT
LC_MESSAGES=en_US
LC_PAPER=mt_MT
LC_NAME=mt_MT
LC_ADDRESS=mt_MT
LC_TELEPHONE=mt_MT
LC_MEASUREMENT=mt_MT
LC_IDENTIFICATION=mt_MT
LC_ALL=

I tried using LocaleDrake and now when i open the terminal the error doesn't show up, howeven when i issue commands the error appears, like for example when i login as root, or when i issue the command locale etc.

As you can see LC_ALL isn't set how can i assign it a value? I have read the manual page of locale but i didn't understood it a lot. Someone can give me ideas please? I am running Mandrake 10.

PS: from the research i have made, i tried setting the values using the command "set LC_ALL=C" and also "set LC_ALL=en_US" but none of them worked.

Regards
asym

the bear 01-20-2006 04:40 PM

I think that what you want to do is type:

export LC_ALL="en_US"

however i think it's not recommended to do this because it will override all your other locale settings. One thing you might try to avoid that is setting it to an empty string. In theory, that value is allowed to be empty which just tells your computer to use the settings above it.

export LC_ALL=""

i have no idea if that will work, but it's worth a shot.

patred 05-05-2006 07:11 AM

export worked for me
 
Thanx the export command worked for me!!

Patred TheKnight

vanchutr 10-05-2007 09:03 PM

locale bug?
 
If i use the "en_US.UTF-8" then I got 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_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=

If i use the "en_US" or "en_AU" then all things are good
# locale
LANG=en_US
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=

How to explain and correct this bug? Any help will welcome. Thank you

Su-Shee 10-06-2007 02:59 PM

You probably miss the locale in UTF-8 encoding.

You can generate it for yourself:

localedef -v -c -i en_US -f UTF-8 en_US.UTF-8

(It's case sensitive as far as I remember, you actually have to use the resulting locale string literally.)

Check with locale -a the locale you actually got on your system.

vanchutr 10-15-2007 08:36 PM

Cannot set LC_ALL to default locale: No such file or directory
 
Thank you Su-Shee,
I'd folowed your instructions but nothing new.
With locale -a, I get this
Code:

# locale -a
locale: Cannot set LC_COLLATE to default locale: No such file or directory
C
POSIX
en_AU
en_CA
en_DK
en_GB
en_NZ
en_PH
en_US
en_US.UTF-8
vi_VN
vi_VN.UTF-8

And this
Code:

# localedef -i en_US -c -f UTF-8 en_US.UTF-8
cannot open locale definition file `translit_neutral': No such file or directory

And this more
Code:

# localedef -v -c -i en_US -f UTF-8 en_US.UTF-8
/usr/share/i18n/locales/en_US:7: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:8: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:9: non-symbolic character value should not be used
/usr/share/i18n/locales/en_US:11: non-symbolic character value should not be used
............. More and more same things

Should you give some more instructions

d00msdaypr0phet 02-07-2008 09:17 PM

I was able to fix this by:

vim /etc/defaults/locale
deleteing the contents and adding LANG=en_US.UTF-8

Saved it and locale -a

ph.gachoud 10-17-2011 09:48 AM

Solved in debian update with sudo locale-gen command

meinhard 05-22-2012 02:54 AM

local locales
 
If you continue to get error messages like

Code:

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

..make sure that the locale you are using locally (as in on the machine that you use to connect to a remote host) is also available on the server.

In my case the default locale on my laptop was en_GB.UTF-8, but the server was using en_US.UTF-8 only. I solved this by adding en_GB.UTF-8 to /etc/default/locale (via "dpkg-reconfigure locales" on a Debian box).

It took me a while to figure this out.. ;)

TheIndependentAquarius 08-27-2012 06:07 AM

Code:

anisha@linux-y3pi:~> uname -a && cat /etc/issue
Linux linux-y3pi 2.6.34-12-desktop #1 SMP PREEMPT 2010-06-29 02:39:08 +0200 x86_64 x86_64 x86_64 GNU/Linux
Welcome to openSUSE 11.3 "Teal" - Kernel \r (\l).

I had upgraded (and then downgraded) the glibc, and therefore I was
facing the same errors while trying to run R, or simple C programs.

The solution for this situation is to install the package glibc-locale.

quenenni 03-24-2013 08:35 PM

Quote:

Originally Posted by meinhard (Post 4684549)
If you continue to get error messages like

Code:

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

..make sure that the locale you are using locally (as in on the machine that you use to connect to a remote host) is also available on the server.

In my case the default locale on my laptop was en_GB.UTF-8, but the server was using en_US.UTF-8 only. I solved this by adding en_GB.UTF-8 to /etc/default/locale (via "dpkg-reconfigure locales" on a Debian box).

It took me a while to figure this out.. ;)

After so many searches, tests, (re)-compilations & configurations, finally, the perfect (and so simple) solution for me.
I find that kind of error msgs quite impossible to determine where the problem was.

I don't know how you figured that out, but well done and thanks for sharing it. :hattip:


All times are GMT -5. The time now is 02:40 PM.