grml / grml-debootstrap

wrapper around debootstrap
59 stars 27 forks source link

update-locale: Error: invalid locale settings: LANG=en_US.UTF-8 LANGUAGE=en_US:en #192

Closed AntonioSun closed 2 years ago

AntonioSun commented 2 years ago

Similar to #48 and #154,

I'm getting:

   Executing stage default_locales
*** update-locale: Error: invalid locale settings:  LANG=en_US.UTF-8 LANGUAGE=en_US:en
 -> Failed (rc=1)

I don't know where this en_US.UTF-8 is coming from, as

and I also tried to put en_US.UTF-8 in after the failure, but the error persists.

$ cat /etc/debootstrap/locale.gen
C
C.UTF-8
POSIX
en_US
en_US.iso88591
en_US.utf8
en_US.UTF-8

Note the last line was put in after the failure.

AntonioSun commented 2 years ago

root@grml:~# type grml-debootstrap
grml-debootstrap is hashed (/usr/sbin/grml-debootstrap)

root@grml:~# grep -n DEFAULT_L /usr/sbin/grml-debootstrap
57:[ -n "$DEFAULT_LANGUAGE" ] || DEFAULT_LANGUAGE='en_US:en'
58:[ -n "$DEFAULT_LOCALES" ] || DEFAULT_LOCALES='en_US.UTF-8'
1683:  [ -n "$DEFAULT_LOCALES" ]     && echo "DEFAULT_LOCALES='$(sed "s,','\\\\'',g" <<<"${DEFAULT_LOCALES}")'"         >> "$CHROOT_VARIABLES"
1684:  [ -n "$DEFAULT_LANGUAGE" ]    && echo "DEFAULT_LANGUAGE='$(sed "s,','\\\\'',g" <<<"${DEFAULT_LANGUAGE}")'"       >> "$CHROOT_VARIABLES"

root@grml:~# cat /etc/issue
grml64-full 2021.07 \n \l

root@grml:~# grml-debootstrap -V
 * grml-debootstrap - version 0.98
 * Report bugs via https://github.com/grml/grml-debootstrap/ or https://grml.org/bugs/

I think line 57 & 58 are wrong. I changed them both to just en_US and it worked for me.

AntonioSun commented 2 years ago

I think line 57 & 58 are wrong. I changed them both to just en_US and it worked for me.

Not when I am providing my own /etc/debootstrap/packages file, by which the installation of the update-locale executable will be triggered, then the error in OP will persist, no matter what I'll be changing the line 57 & 58 to (changing to en_US will no longer be working).

mika commented 2 years ago
* I don't have it in `/etc/debootstrap/locale.gen`,

and I also tried to put en_US.UTF-8 in after the failure, but the error persists.

$ cat /etc/debootstrap/locale.gen
C
C.UTF-8
POSIX
en_US
en_US.iso88591
en_US.utf8
en_US.UTF-8

Note the last line was put in after the failure.

Your /etc/debootstrap/locale.gen file doesn't contain valid/supported configuration, see /usr/share/i18n/SUPPORTED - as mentioned in the file - what are valid entries. So I'm afraid, I'm not sure what you're reporting here? :)

AntonioSun commented 2 years ago

Your /etc/debootstrap/locale.gen file doesn't contain valid/supported configuration

Would you point out which entry is invalid please?

That's the list I always use and it is also produced right from my Debian machine with locale -a.

mika commented 2 years ago

When placing the following snippet into file /etc/locale.gen:

C
C.UTF-8
POSIX
en_US
en_US.iso88591
en_US.utf8
en_US.UTF-8

... can you really execute locale-gen then? IMO that can't work. To clarify: locale -a just lists which locales are available, this is different from locale-gen which generates them.

AntonioSun commented 2 years ago

Oh, Ah, I got it. thanks.