how to solve Ubuntu setlocale() warning

bob 295 icanprogram-sKcZck+fQKg at public.gmane.org
Thu Oct 14 14:19:11 UTC 2010


On Thursday 14 October 2010 09:51 am, Lennart Sorensen wrote:
> On Thu, Oct 14, 2010 at 09:30:18AM -0400, bob 295 wrote:
> > Here is what I get when I run dpkg-reconfigure locales
> >
> > ======= begin snip =============
> > perl: warning: Setting locale failed.
> > perl: warning: Please check that your locale settings:
> > 	LANGUAGE = (unset),
> > 	LC_ALL = "en_US",
> > 	LANG = "en_US"
> >     are supported and installed on your system.
> > perl: warning: Falling back to the standard locale ("C").
> > 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 /bin/bash: warning: setlocale: LC_ALL: cannot change locale
> > (en_US) Generating locales...
> >   en_AG.UTF-8... up-to-date
> >   en_AU.UTF-8... up-to-date
> >   en_BW.UTF-8... up-to-date
> >   en_CA.UTF-8... up-to-date
> >   en_DK.UTF-8... up-to-date
> >   en_GB.UTF-8... up-to-date
> >   en_HK.UTF-8... up-to-date
> >   en_IE.UTF-8... up-to-date
> >   en_IN.UTF-8... up-to-date
> >   en_NG.UTF-8... up-to-date
> >   en_NZ.UTF-8... up-to-date
> >   en_PH.UTF-8... up-to-date
> >   en_SG.UTF-8... up-to-date
> >   en_US.UTF-8... up-to-date
> >   en_ZA.UTF-8... up-to-date
> >   en_ZW.UTF-8... up-to-date
> > Generation complete.
> >
> > ====== end snip =========
> >
> > This is an Ubuntu system and if I understand things it won't prompt me
> > for locales like it does on a true Debian system.
>
> Well it has en_US generated, so that should be OK.
>
> You can probably make it prompt by changing the priority.
>
> I think it is dpkg-reconfigure -p low locales
>
> But that doesn't appear to be the issue.
>
> No idea why it says it can't use locale en_US when it clearly has that
> locale generated.  Unless something is broken and makes it think it
> can't use the .UTF8 version.
>
> You could try setting LC_ALL and LANG to en_US.UTF8 and see if that helps.

If I type 

export LC_ALL="en_US.UTF-8"

the warning disappears !!!    Didn't change the LANG environment variable.   
Now the "locale" command also runs without warnings.   

Is there a mechanism to create a locale alias for en_US?  or do I have to add 
the line

LC_ALL="en_US.UTF-8"

to 

/etc/default/locale

as some on the Net are suggesting for an Ubuntu system.

Just curious do you know where LC_ALL is defined on an Ubuntu system?   I did 
some cursory grep's in /etc and in my hidden files and it didn't come up.

Thanks in advance for all your help.

bob
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list