1、下载中文字符集包
apt-get install language-pack-zh-hant-base language-pack-zh-hans-base
2、进入字符图形话界面选择zh_CN.UTF-8或者你需要的
dpkg-reconfigure locales
3、进行初始化
locale-gen zh_CN.UTF-8
4、配置字符集环境变量
在/etc/profile添加
export LC_ALL=zh_CN.UTF-8export LANG=zh_CN.UTF-8
在/etc/environment添加
LC_ALL="zh_CN.UTF-8"LANG="zh_CN.UTF-8"
centos可以参考https://www.cnblogs.com/zhanggaofeng/p/13796123.html
