shell登录后报错,类似以下几行
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
分析:
locale -a 只有C 和 POSIX,而 /etc/sysconfig/i18n 里LANG="en_US.UTF-8"
一阵搜索之后,需要添加en_US.UTF-8的 locale
root执行:localedef -i en_US -f UTF8 en_US.UTF-8
报错,未能完成
由于是升级而来,可能是locale旧的文件不兼容
于是重新安装 glibc-common 和 vzdummy-glibc.noarch
/usr/lib/locale/locale-archive
瞬间变成95M
接下来精简此文件
cd /usr/lib/locale/
mv locale-archive locale-archive_back
localedef -i en_US -f UTF8 en_US.UTF-8
localedef --list-archive
终于有了C POSIX en_US.utf8
重新登录shell 不再报错
阅读(1483) | 评论(1) | 转发(0) |