echo $LANG 显示当前所用的语言编码
locale -a 查看所有的编码集,看是否有中文的编码集,如果没有,就需要安装中文包
yum groupinstall chinese-support -y
yum install kde-l10n-Chinese #centos7及以上用这个
修改i18n和locale.conf配置文件,i18n 在centos7版本中已经没有了,需要手动创建一个i18n文件,添加如下行
LANG="zh_CN.UTF-8"
LC_ALL="zh_CN.UTF-8"
source /etc/sysconfig/i18n #加载下此文档
vim /etc/locale.conf #编辑文档,将其改为LANG=zh_CN.UTF-8即可