1. 查看编码
[root@dev_pc1 sysconfig]# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
2. 查看是否有中文包
[root@dev_pc1 sysconfig]# locale -a |grep 'zh_CN'
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8
3. 创建i18n文件
[root@dev_pc1 sysconfig]# pwd
/etc/sysconfig
[root@dev_pc1 sysconfig]# touch i18n
[root@dev_pc1 sysconfig]# vi i18n
LANG='zh_CN.UTF-8'
LC_ALL='zh_CN.UTF-8'
使生效
source /etc/sysconfig/i18n
locale#see see
4. 编辑locale.conf
[root@dev_pc1 sysconfig]# vi /etc/locale.conf
#LANG="en_US.UTF-8"
LANG="zh_CN.UTF-8"