[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#365628: postinst fails when LANG doesn't point to a valid locale



Package: locales
Version: 2.3.6-7
Severity: important
Tags: patch

# LANG=xx_XX DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
[...]
*** update-locale: Error: invalid locale settings:

when "update-locale LANG" is invoked, it verified LANG variable and, if invalid,
aborts the script.

The typical situation when this happens is:

  - You had belocs-locales-data installed.
  - You had LANG set to a locale that is only available in belocs, and not in
    glibc locales.
  - You attempt to replace belocs-locales-data with glibc locales.

The following fix worked for me:

--- /var/lib/dpkg/info/locales.postinst~        2006-04-14 15:45:25.000000000 +0200
+++ /var/lib/dpkg/info/locales.postinst 2006-05-01 17:46:22.000000000 +0200
@@ -66,7 +66,7 @@
     # Set default LANG environment variable
     if [ -e $EE ]; then
         # Remove previous definitions
-        /usr/sbin/update-locale LANG
+        LANG= /usr/sbin/update-locale LANG
     fi
     if [ -n "$SELECTED" ] && [ "$SELECTED" != "None" ]; then
         /usr/sbin/update-locale "LANG=$SELECTED"

But according to the manpage, I don't see why update-locale should care about
the LANG env variable.  Perhaps the problem is there?

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-amd64-k8
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ANSI_X3.4-1968) (ignored: LC_ALL set to C)

Versions of packages locales depends on:
ii  debconf [debconf-2.0]         1.4.72     Debian configuration management sy
ii  libc6 [glibc-2.3.6-2]         2.3.6-7    GNU C Library: Shared libraries

locales recommends no packages.

-- debconf information excluded



Reply to: