解决方法
- 暂时性处理:
export LC_ALL="zh_CN.UTF-8"
- 一劳永逸
vim /etc/bashrc
然后在最后一行写入:
export LC_ALL="zh_CN.UTF-8"
问题复现&解析
当输入:
locale
会得到如下结果:
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: ?????????
LANG=zh_CN.UTF-8
LC_CTYPE=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=
而且当使用程序的时候,系统的反馈会变成如下这样有很多"?"出现的情况
??? pygpgme-0.3-9.el7.x86_64 ??????????
??? yum-utils-1.1.31-54.el7_8.noarch ??????????
??????