如何在CentOS 7上添加语言支持(在Docker上)?

前端之家收集整理的这篇文章主要介绍了如何在CentOS 7上添加语言支持(在Docker上)?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试将语言环境设置为日语,但Docker上的CentOS映像不包含语言支持.
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

我已经通过yum grouplist和yum grouplist隐藏了grouplist,并且都没有包含日语支持.
有没有办法安装日语支持
提前致谢.

我对RHEL 7.4 docker镜像有同样的问题. yum重新安装glibc-common本身并没有解决问题.它只是安装英语.

我发现在我的docker容器/etc/yum.conf中包含了override_install_langs = en_US行.这导致yum重新安装glibc-common只能安装英语.

将此行注释掉(或更改为默认值all),并重新运行yum重新安装glibc-common我能够使用其他语言

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

我在更改/etc/yum.conf之前尝试重新安装glib-common

# 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
#

更改/etc/yum.conf后注释掉行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

猜你在找的CentOS相关文章