4

We are running a Werewolf cluster and the node images are missing the locales. Only C and POSIX are available. The system uses CentOS 7 as base.

It isn't really an issue but it's a very annoying to receive warnings at each command, like those:

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_COLLATE to default locale: No such file or directory

I've double checked if glibc is installed and everything appears to be ok:

[root@n01 ~]# rpm -qa | grep -i glibc
glibc-common-2.17-106.el7_2.6.x86_64
glibc-headers-2.17-106.el7_2.6.x86_64
glibc-2.17-106.el7_2.6.x86_64
glibc-devel-2.17-106.el7_2.6.x86_64 

And locale -a outputs this:

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_COLLATE to default locale: No such file or directory
C
POSIX

Any idea to generate all the missing locales?

HBruijn
  • 77,029
  • 24
  • 135
  • 201
Vinícius Ferrão
  • 5,520
  • 11
  • 55
  • 95

3 Answers3

2

A tad late, but yum has glibc-langpack-* modules:

yum list glibc-langpack-\*
Jelmer Jellema
  • 321
  • 2
  • 8
1

You could try

yum reinstall glibc-common

which should just erm, reinstall the package.

user9517
  • 115,471
  • 20
  • 215
  • 297
  • 1
    Already tried this. Unfortunately it does not work. :( – Vinícius Ferrão Jul 09 '16 at 19:47
  • 1
    It would have been a good thing to mention that then. – user9517 Jul 09 '16 at 20:50
  • @ViníciusFerrão did you solve this? Same problem for me on a brand new AWS EC2 instance. I'm missing the language packs and cannot figure out how to generate them. – EvilJordan Sep 16 '19 at 23:17
  • 2
    Update: I fixed this, probably not in the best way, but it works, and could not find any solution to reinstalling/replacing the missing files another way. My `/usr/share/i18n/locales` and `/usr/share/i18n/charmaps` folders were completely empty. No amount of reinstalling packages seemed to fix this. I finally took the contents of the folder from another instance that was working fine, then ran `sudo localedef -i en_US -f UTF-8 en_US.UTF-8` to generate the locale information for me. `locale -a` now shows en_US as available and all my errors are gone. – EvilJordan Sep 16 '19 at 23:41
0

since I don't find any better answer, you fix this by setting LANG , LANGUAGE and LC_ALL on logon, for example on /etc/profile add :

export LANG=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
Sérgio
  • 281
  • 2
  • 6