azurelinux icon indicating copy to clipboard operation
azurelinux copied to clipboard

locale-gen.sh does not work because of missing referenced locales

Open JelteF opened this issue 3 years ago • 7 comments

The file /usr/share/i18n/locales contains only en_US, but that file references other locale files that are not part of the Mariner installation.

So when you run locale-gen.sh you get the following error:

en_US.ISO-8859-1...[error] cannot open locale definition file `en_GB': No such file or directory

To make locale generation work I had to copy the following locales from my Ubuntu install:

  1. en_GB
  2. i18n
  3. i18n_ctype
  4. iso14651_t1
  5. iso14651_t1_common
  6. translit_* (it was missing many of these, but maybe not all are necessary)

JelteF avatar May 23 '22 08:05 JelteF

I just ran into this and found a workaround - install glibc-i18n which (at a whopping 15Mb!) includes all the additional locale definition files.

Still seems like locale-gen.sh should work out of the box without needing to install other packages manually.

bossmc avatar Aug 25 '22 22:08 bossmc

@JelteF, Install the package glibc-i18n since it is not pre-installed. We are closing the issue since it is not a bug.

Malateshk007 avatar Apr 29 '24 10:04 Malateshk007

I really don't understand why you are not considering this a bug. The en_US.ISO-8859-1 locale does not work!

JelteF avatar Apr 29 '24 10:04 JelteF

@JelteF , as we informed you, we have created internal ADO bug to handle the issue and we are re-opening this issue.

Malateshk007 avatar May 03 '24 06:05 Malateshk007

To document my clarification of the problem here too. The locale-gen.sh command that's included in the base image fails when run.

❯ docker run -it mcr.microsoft.com/cbl-mariner/base/core:2.0 /bin/bash
root [ / ]# locale-gen.sh
Generating locales...
  en_US.ISO-8859-1...[error] cannot open locale definition file `en_GB': No such file or directory

I feel like there are two options to resolve this:

  1. Don't include locale-gen.sh in the base image and only install it when glibc-i18n is installed. And the same should then be done for the file /usr/share/i18n/locales/en_US.
  2. Make sure that locale-gen.sh doesn't fail when run by removing the en_US lines from /etc/locale-gen.conf. (and probably also removing /usr/share/i18n/locales/en_US.
  3. Make sure that locale-gen.sh doesn't fail when run by adding all the necessary files for en_US to be compiled to the base image.

JelteF avatar May 03 '24 07:05 JelteF