LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-17-2004, 01:28 AM   #1
asym
LQ Newbie
 
Registered: Jul 2004
Location: Malta
Distribution: Fedora C2
Posts: 3

Rep: Reputation: 0
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
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 01-20-2006, 04:40 PM   #2
the bear
LQ Newbie
 
Registered: Jan 2006
Posts: 9

Rep: Reputation: 2
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.
 
2 members found this post helpful.
Old 05-05-2006, 07:11 AM   #3
patred
LQ Newbie
 
Registered: Aug 2004
Location: India
Distribution: Mandrake
Posts: 3

Rep: Reputation: 0
export worked for me

Thanx the export command worked for me!!

Patred TheKnight
 
Old 10-05-2007, 09:03 PM   #4
vanchutr
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
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

Last edited by vanchutr; 10-06-2007 at 04:42 AM.
 
Old 10-06-2007, 02:59 PM   #5
Su-Shee
Member
 
Registered: Sep 2007
Location: Berlin
Distribution: Slackware
Posts: 510

Rep: Reputation: 53
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.
 
0 members found this post helpful.
Old 10-15-2007, 08:36 PM   #6
vanchutr
LQ Newbie
 
Registered: Aug 2006
Posts: 6

Rep: Reputation: 0
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
 
0 members found this post helpful.
Old 02-07-2008, 09:17 PM   #7
d00msdaypr0phet
Member
 
Registered: Mar 2005
Location: Oregon
Distribution: Debian, Ubuntu, Whatever
Posts: 32

Rep: Reputation: 15
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
 
0 members found this post helpful.
Old 10-17-2011, 09:48 AM   #8
ph.gachoud
LQ Newbie
 
Registered: Oct 2011
Posts: 2

Rep: Reputation: Disabled
Solved in debian update with sudo locale-gen command
 
2 members found this post helpful.
Old 05-22-2012, 02:54 AM   #9
meinhard
LQ Newbie
 
Registered: Jan 2009
Posts: 2

Rep: Reputation: 3
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..
 
3 members found this post helpful.
Old 08-27-2012, 06:07 AM   #10
Aquarius_Girl
Senior Member
 
Registered: Dec 2008
Posts: 4,731
Blog Entries: 29

Rep: Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940Reputation: 940
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.
 
Old 03-24-2013, 08:35 PM   #11
quenenni
LQ Newbie
 
Registered: Mar 2013
Posts: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by meinhard View Post
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.
 
Old 10-24-2018, 05:54 PM   #12
LocaleShop
LQ Newbie
 
Registered: Oct 2018
Posts: 2

Rep: Reputation: Disabled
LOCPATH environment variable

I managed to cause this myself when migrating home directory dot files to a new machine, and I failed to identify the cause for a while on account of searching files for LC_ and not LOC.

The ~/.bashrc file I copied had the following:

Code:
export LOCPATH=/var/guix/profiles/per-user/root/guix-profile/lib/locale
(the particular value here was on account of prior experiments with GNU Guix on the old machine; but the relevant fact is simply that the environment variable was set to a now-invalid path.)

This resulted in the following error when running various programs:

Code:
Warning: locale not supported by C library, locale unchanged
And these errors when running 'locale':

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
Removing (or commenting out) the 'LOCPATH' line resolved my issues.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change the locale by setting the system default locale letdoit Slackware 6 08-18-2011 03:34 AM
"locale not supported by Xlib, locale set to C" Irad Linux - Software 3 06-25-2006 03:59 PM
quick question (LC_ALL locale) spamhippy Slackware 6 11-29-2005 04:49 AM
how can i set locale modifiers? pingY Slackware 6 01-04-2004 10:39 AM
set locale... pixelV Linux - Software 14 03-17-2003 07:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration