大网数据广告活动
服务器运维问答

How to add language support on CentOS 7 (on Docker)?

· 52CE 我爱测

I'm trying to set locale to Japanese, but CentOS image on docker doesn't include language support. bash-4.2# yum groupinstall -y "Japanese Support" Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: …

问题原文

原帖链接 · DIGITALSQUAD · CC BY-SA 3.0

I'm trying to set locale to Japanese, but CentOS image on docker doesn't include language support.

bash-4.2# yum groupinstall -y "Japanese Support"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.btte.net
 * extras: centos.mirror.secureax.com
 * updates: centos.mirror.secureax.com
Warning: group Japanese Support does not exist.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

I've checked grouplist by yum grouplist and yum grouplist hidden and neither include Japanese Support.
Is there any way to install Japanese Support?
Thanks in advance.

社区高分解答

原帖链接 · William D. Irons · CC BY-SA 3.0

I had the same problem with a RHEL 7.4 docker image. yum reinstall glibc-common by itself didn't resolve the problem. It was only installing English.

I found in my docker container /etc/yum.conf contained the line override_install_langs=en_US. This caused yum reinstall glibc-common to only install English.

With this line commented out (or changed to the default value of all), and re-running yum reinstall glibc-common I was able to use other languages

Initial Environment after docker run/attach

# locale -a
C
POSIX
en_US.utf8
# grep lang /etc/yum.conf
override_install_langs=en_US
# export LANG=fr_FR
# ls foo
ls: cannot access foo: No such file or directory

My attempt at reinstalling glib-common before changing /etc/yum.conf

# yum -y -q reinstall glibc-common
Failed to set locale, defaulting to C
# ls foo
ls: cannot access foo: No such file or directory
# 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
en_US.iso88591
en_US.iso885915
en_US.utf8
#

After changing /etc/yum.conf to comment out the line override_install_langs=en_US

# vi /etc/yum.conf
# grep lang /etc/yum.conf
#override_install_langs=en_US
# yum -y -q reinstall glibc-common
Failed to set locale, defaulting to C
# ls foo
ls: cannot access foo: Aucun fichier ou dossier de ce type
# locale -a | wc -l
789

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-07-31)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。