查看系统版本[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.0.1406 (Core)
安装语言包[root@localhost ~]# yum groupinstall "fonts"
查看系统是否有安装中文语言包 (列出所有可用的公共语言环境的名称,包含有zh_CN)[root@localhost ~]# locale -a |grep "zh_CN"
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
若发现以上几项,说明系统已安装中文语言包,无需再安装
{语言代号}_{国家代号}.{字符集}
zh是中文的代号、CN是中国的代号、gb18030,gb2312,utf8是语言字符集
[root@localhost ~]# cat /etc/locale.conf
LANG=en_US.UTF-8[root@localhost ~]# cp /etc/locale.conf /etc/locale.conf_bak[root@localhost ~]# vim /etc/locale.conf # 修改后原英文错误信息会变成中文信息
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.UTF-8:zh_CN:zh:en_US.UTF-8:en_US:en"
SYSFONT="lat0-sun16"
or[root@localhost ~]localectl set-locale LANG=zh_CN.UTF-8
[root@localhost ~]# reboot # 重新系统
[root@localhost ~]# echo $LANG # 查看当前使用的系统语言
zh_CN.UTF8
or[root@localhost ~]# locale
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=[root@localhost ~]# export.UTF8 # 将系统语言临时设置为中文,export方式不需要重新登录
[root@localhost ~]#