MENU

Centos7报错Failed to set locale, defaulting to C

February 5, 2018 • Read: 787 • 无码

在新安装的centos7环境中,执行yum报错Failed to set locale, defaulting to C;使用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=zh_CN.UTF-8
LC_CTYPE=zh_CN.UTF-8
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=

cat /etc/locale.conf却是LANG="en_US.UTF-8",将其修改为LANG="zh_CN.UTF-8"

安装语言包:

yum install kde-l10n-Chinese

yum reinstall glibc-common

再次执行locale,设置正常了。

Tags: Linux
Archives QR Code
QR Code for this page
Tipping QR Code