I'm runing debian etch, and things worked until recently when I tried
to reconfigure locales. Somehow I found myself in a position where I
can't reconfigure locales, and snooping online suggests there's no
simple solution.
$ locale
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
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=
My impression is that that en_US.UTF-8 _is_ the default locale for
debian, but my changing the default locale from en_US to none does not
help.
The kind of error messages I get from chron, or when triing to install
a package, or when recondiguring locals is:
...
Generating locales (this might take a while)...
en_US.ISO-8859-1... done
Generation complete.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
There seems to be no problem with my system's supporting en_US:
$ locale -a
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_COLLATE to default locale: No such file or directory
C
POSIX
en_US
en_US.iso88591
What does "no such file or directory" refer to?
Online searching suggested defining environment variables for
LC+CTYPE, LC_MESSAGES, LC_COLLATE. The only obviously relevant
environment variable I have is:
$ printenv
...
LANG=en_US.UTF-8
...
Should I go ahead and have root insert environment variables such as LANGUAGE =
"en_US.UTF-8" into its environment and then run # dpkg-reconfigure
locales again?
--
Haines Brown, KB1GRM
--
Bookmark/Search this post with:
Locale won't set
Hi Haines.
Haines Brown, 31.08.2007 18:49:
> There seems to be no problem with my system's supporting en_US:
>
> $ locale -a
> 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_COLLATE to default locale: No such file or directory
> C
> POSIX
> en_US
> en_US.iso88591
>
> What does "no such file or directory" refer to?
Find it out:
$ strace -eopen locale -a
That’s the way it looks like when everything’s OK:
> $ strace -eopen locale -a
> open("/etc/ld.so.cache", O_RDONLY) = 3
> open("/lib/i686/cmov/libc.so.6", O_RDONLY) = 3
> open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
> open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
> open("/usr/lib/locale", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
> open("/usr/share/locale/locale.alias", O_RDONLY) = 3
> C
> de_DE.utf8
> POSIX
> Process 2577 detached
Maybe it helps.
Regards, Mathias
--
debian/rules
Locale won't set
Florian Kulzer writes:
> On Sat, Sep 01, 2007 at 07:28:10 -0400, Haines Brown wrote:
> > I believe I'm getting closer.
> >
> > I can't reinstall locales because with locales broken, I can't install
> > any packages. Is it possible to do a package installation without its
> > calling locales?
>
> Did you already try to reconfigure the "locales" package like this:
>
> LANG=C LC_ALL=C dpkg-reconfigure locales
Unfortunately, that syntax is not supported on my machine. Perhaps I
misunderstood it.
> If the above does not work then you can check if /etc/locale.gen
> contains a line for en_US.UTF-8 and then you can run
>
> locale-gen
>
> directly to create the localization data. (See also the comments in
> /etc/locale.gen.)
That seems to have done it. Thanks for the
clarification. Incidentally, my locale.gen file is not commented for
some reason.
--
Haines Brown, KB1GRM
--
Locale won't set
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Haines Brown wrote:
> I'm runing debian etch, and things worked until recently when I tried
> to reconfigure locales. Somehow I found myself in a position where I
> can't reconfigure locales, and snooping online suggests there's no
> simple solution.
[snip]
> Should I go ahead and have root insert environment variables such as LANGUAGE =
> "en_US.UTF-8" into its environment and then run # dpkg-reconfigure
> locales again?
>
Maybe you could try 'aptitude reinstall locales'. Don't know if this
would work, though. (It can't hurt, I guess ;-)
Johannes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFG2ErAC1NzPRl9qEURAuHXAJ9ZSJwrijMUJvTHBUXXVy1L5ztNJQCfZR5i
GvTiUVf525XXgpIfEGFpJfg=
=D5jh
-----END PGP SIGNATURE-----
--
Locale won't set
On Fri, Aug 31, 2007 at 07:07:13PM +0200, Johannes Wiedersich wrote:
>
> Haines Brown wrote:
> > I'm runing debian etch, and things worked until recently when I tried
> > to reconfigure locales. Somehow I found myself in a position where I
> > can't reconfigure locales, and snooping online suggests there's no
> > simple solution.
Try this:
http://www.debiantutorials.org/talkitup/index.php?topic=1591.0
--
Regards, Paul Csanyi
http://www.freewebs.com/csanyi-pal/index.htm
--
Locale won't set
I believe I'm getting closer.
I can't reinstall locales because with locales broken, I can't install
any packages. Is it possible to do a package installation without its
calling locales?
Mathias' suggestion that I run strace on the locale command did lead
me to stumble on a likely culprit:
$ strace -eopen locale -a
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/tls/i686/cmov/libc.so.6", O_RDONLY) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3
open("/usr/share/locale/locale.alias", O_RDONLY) = 3
open("/usr/lib/locale/en_US.UTF-8/LC_CTYPE", O_RDONLY) = -1 ENOENT (No such file or directory)
...
This -1 error and the others that followed led me to
/usr/lib/locales. I found no no "en_UTF-8" directory there, but to
judge from backups, apparently there shouldn't be. My guess is that
the the values for the locales variables are looked up in the
locale-archive binary file found there.
I did discover that my last four system backups had a
/usr/lib/locale/local-archive file that was about 1.21 Mb in size and
had remained the same since I first installed etch in April. However,
a week ago the file suddenly shrank to 320 Kb.
It seemed likely to me that this file was broken at that time, and a
simple fix would be to copy the old version of the locale-archive file
over from the backup. However, given that I don't have any clue how
the locale system works, I'd appreciate a suggestion that a simple
recovery of the original locale-archive file from backup would be
OK and whether there are any other steps I need to take.
--
Haines Brown, KB1GRM
--