Domino on Linux/Unix, Troubleshooting, Best Practices, Tips and more ...

"Locale" issue on Linux CentOS & RHEL

Daniel Nashed  26 October 2019 18:40:14

"Locale" issue on Linux CentOS & RHEL



I ran into this with Domino on Docker. I noticed that the locale settings have not been detected correctly by Domino when running on CentOS with the German locale.

It turned out that this is a more general issue on Docker with other locales than LANG=C or LANG=en_US.UTF-8


There are differences between CentOS/RHEL 7 and the new version 8 where the language support in glibc has changed!


The issue in version 7 only impacts Docker environments. But with the new language handling in CentOS/RHEL8 this also impacts native applications on Linux.


When the locale is broken you see following error messages when checking the "locale":


export LANG=de_DE.UTF-8

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=de_DE.UTF-8

LC_CTYPE="de_DE.UTF-8"

LC_NUMERIC="de_DE.UTF-8"

LC_TIME="de_DE.UTF-8"

LC_COLLATE="de_DE.UTF-8"

LC_MONETARY="de_DE.UTF-8"

LC_MESSAGES="de_DE.UTF-8"

LC_PAPER="de_DE.UTF-8"

LC_NAME="de_DE.UTF-8"

LC_ADDRESS="de_DE.UTF-8"

LC_TELEPHONE="de_DE.UTF-8"

LC_MEASUREMENT="de_DE.UTF-8"

LC_IDENTIFICATION="de_DE.UTF-8"

LC_ALL=



CentOS 7 / RHEL7


It took a while to figure out why this is happening. And it turned out that for Docker the CentOS base image does only contain English in the glibc package.


There is a setting in /etc/yum.conf which causes that only the English locale is installed -apparently to save a bit of storage (it's not really much..).


The solution is to remove the following line from /etc/yum.conf


override_install_langs=en_US.utf8



Afterwards to reinstall the glibc-common. In some cases that doesn't work and you need to update it instead


yum reinstall -y glibc-common  
or  yum update -y glibc-common

For our Docker project this means we have to change the setting during the Docker build process and than update the glibc-common package.

In CentOS /RHEL 7 this only affects Docker and I have seen the discussion about this issue in the Docker community.
But I didn't find any solution. So I am documenting it in my blog to make it searchable.



CentOS/RHEL 8


With CentOS/RHEL 8 they have completely changed the way language support in glibc is handled.

This does not only affect Domino on Docker but also natively installed.


There is an interesting article about it on the RedHat website:


https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/configuring_basic_system_settings/installing-using-langpacks


They are mentioning a glibc-all-langpacks
which can be used instead of the smaller package glibc-minimal-langpack which is installed by default.

But even when installing this package you don't get all the languages installed. Instead this is the packet which sort of manages the other languages you can install.

There is an alternate solution to install glibc langauge packs (also mentioned in the article) but that's not recommended because it is slower as they say.

So what you need to do when you want to install additional languages is to first install the language packs named for example langpacks-en and than install glibc-all-langpacks
.

yum install -y langpacks-en langpacks-de glibc-all-langpacks


Only with this combination your locale works as expected and the "locale" command does not complain about missing files.


For Docker we will take care about this in the Docker Project. We will have to see which languages we install by default in future with CentOS 8 (it's not yet supported by Domino).

But for CentOS 7 we will just update the glibc-common package as described above.



-- Daniel



Archives


  • [IBM Lotus Domino]
  • [Domino on Linux]
  • [Nash!Com]
  • [Daniel Nashed]