Centos 7 从 英文字符集改为中文字符集后,启动服务器出现下面的情况:
Connecting to 192.168.5.61:22...Connection established.To escape to local shell, press 'Ctrl+Alt+]'.Last login: Tue Sep 18 03:16:14 2018 from 192.168.5.1-bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_US.UTF-8): No such file or directory-bash: warning: setlocale: LC_COLLATE: cannot change locale (zh_US.UTF-8): No such file or directory-bash: warning: setlocale: LC_MESSAGES: cannot change locale (zh_US.UTF-8): No such file or directory-bash: warning: setlocale: LC_NUMERIC: cannot change locale (zh_US.UTF-8): No such file or directory-bash: warning: setlocale: LC_TIME: cannot change locale (zh_US.UTF-8): No such file or directory
解决办法:修改 /etc/locale.conf (Centos 6 修改/etc/sysconfig/i18n文件)
刚开始文件的内容是:
[root@zabbix ~]# cat /etc/locale.confLANG="zh_CN.utf8"
更改后的文件内容是:
[root@zabbix ~]# cat /etc/locale.confLC_ALL="zh_CN.utf8"LC_CTYPE="zh_CN.utf8"LANG="zh_CN.utf8"