--Environment --Container created with Docker - CentOS Linux release 7.7.1908 (Core) - CUI : Xfce - xfce4-terminal 0.8.7.4
yum check
$ sudo yum check
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, ovl
check all
#LC when checking environment variables_There is no ALL
$ printenv | grep LC
$
#Set
$ export LC_ALL=C
#check
$ printenv | grep LC
LC_ALL=C
#Try again
$ sudo yum check
Loaded plugins: fastestmirror, ovl
check all
Failed to set locale, defaulting to C is displayed when executing a command on RHEL8 --Qiita
# 「ja_JP.UTF-Even if "8" is set ...
$ localectl
System Locale: LANG=ja_JP.UTF-8
VC Keymap: us
X11 Layout: us
# 「ja_JP.UTF-It is said that there is no 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=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
#"Ja" in the configurable locale_JP.UTF-8 "is not
$ localectl list-locales
en_US.utf8
$ locale -a
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
en_US.utf8
#Not even in the installable language package ...
$ sudo yum list langpacks-*
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror, ovl
Repository google-chrome is listed more than once in the configuration
Loading mirror speeds from cached hostfile
* base: ty1.mirror.newmediaexpress.com
* epel: nrt.edge.kernel.org
* extras: ty1.mirror.newmediaexpress.com
* updates: ty1.mirror.newmediaexpress.com
Error: No matching Packages to list
yum update
is done.I added Japanese with localedef
in the Docker definition file, but for some reason there is no Japanese locale. The answer was on the following page.
Docker's centos: centos7 has zero
locale -a | grep -c ja_JP
, which means that the Japanese locale is not defined. ... omitted ... If youyum update
glibc-common, it will disappear w Add an indelible Japanese locale to the CentOS 7 container-Qiita
Kill the cannot change locale --ARCHIVESDRIVE HB
# 「ja_JP.UTF-8 "is added
$ sudo localedef -f UTF-8 -i ja_JP ja_JP
#added!
$ localectl list-locales
en_US.utf8
ja_JP
ja_JP.utf8
$ locale -a
C
POSIX
en_US.utf8
ja_JP
ja_JP.utf8
#The error message has disappeared!
$ locale
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=ja_JP.UTF-8
#did it!
$ sudo yum check
Loaded plugins: fastestmirror, ovl
Repository google-chrome is listed more than once in the configuration
check all
Recommended Posts