utf-8localeredhat-containers

How to fix 'character map file `UTF-8' not found'


I'm setting up a UBI rhel8 container. I need to execute this command:

localedef -f UTF-8 -i en_US en_US.UTF-8

which failed with:

character map file `UTF-8' not found: No such file or directory
cannot read character map directory `/usr/share/i18n/charmaps': No such file or directory

Solution

  • You need to install these packages

    yum -y install glibc-locale-source glibc-langpack-en
    

    and then re-run localedef command