Fwd: Howto fix "setting locale failed"

Eric Dunbar eric.dunbar at gmail.com
Sun Jan 16 08:26:02 CST 2005


Hello developer-type people:

When I upgraded from Warty to Hoary (mid-late November IIRC) I
upgraded using upgrade-distro (or was that distro-upgrade) and set the
language before I upgraded (wiki:
<http://www.ubuntulinux.org/wiki/GuideToHoary>).

Anyway, since then I've always gotten "setting locale failed" errors
with LANGUAGE, LC_ALL, LANG variables as shown in the FWD part of this
message. The problem was that the package "locales" was not installed
under Hoary. Is this an oversight in the Warty->Hoary upgrade "path"
that was in use in November or is this something that still could go
wrong if you do things in the order I did them?

I've been (SLOWLY) making my way through the archives for references
on this today (a searchable interface would be nice) and came across
the following threads (aside from the recent one in users):

<http://lists.ubuntu.com/archives/ubuntu-users/2004-November/009705.html>
<http://lists.ubuntu.com/archives/ubuntu-users/2004-November/010944.html>

Anyway, thought I'd point this out in case it's something that's still
a problem.

Eric.

>From Ubuntu-users:

---------- Forwarded message ----------
From: Eric Dunbar
Date: Sat, 15 Jan 2005 22:12:07 -0500
Subject: Re: Howto fix this warning of locales
To: Danilo Piazzalunga
Cc: ubuntu-users

On Sun, 16 Jan 2005 03:40:31 +0100, Danilo Piazzalunga wrote:
> maikhai wrote:
> > perl: warning: Setting locale failed.
> > perl: warning: Please check that your locale settings:
> >         LANGUAGE = "en_US:en_GB:en",
> >         LC_ALL = (unset),
> >         LANG = "en_US.UTF-8"
> >     are supported and installed on your system.
> > perl: warning: Falling back to the standard locale ("C").
> >
> > Pls show me howto fix this? (I always use LANG=en_US.UTF-8 in my system)
>
> Usually this means that your locale wasn't generated. What is the content
> of /etc/locale.gen?
>
> Try running 'sudo dpkg-reconfigure locales' and make sure that your locale
> (en_US.UTF-8) is selected from the list and set as default.
>
> Is it all right now? If not, what was the output of the command and
> what is the content of /etc/locale.gen?

Hello, I had the same problem from when I first upgraded to Hoary. On
a hunch I installed the package locales and it fixed my problems!!!

See the following for the output of dpkg-reconfigure & apt-get:

eric at UbuntuOnPismo:~ $ sudo dpkg-reconfigure locales
Password:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_CA:en_GB:en_US:en",
        LC_ALL = (unset),
        LANG = "en_CA.UTF-8"
    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
/usr/sbin/dpkg-reconfigure: locales is broken or not fully installed

eric at UbuntuOnPismo:~ $ sudo apt-get install locales



More information about the ubuntu-devel mailing list