升级glibc库后,使用SecureCRT登录linux,提示:
ast login: Mon Feb 20 02:03:21 2017 from 192.168.4.187
-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory
执行more /etc/sysconfig/i18n命令检查系统字符集
[[email protected] ~]# more /etc/sysconfig/i18n
LANG="en_US.UTF-8"
SUPPORTED="zh_CN.GB18030:zh_CN:zh:zh_CN.UTF-8:en_US:en"
SYSFONT="latarcyrheb-sun16"
执行locale命令,提示如下异常,说明说明没安装en_US的local
[[email protected] ~]# locale
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
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=
解决方案,修改如下:
vi /etc/sysconfig/i18n
# 添加下面的
LC_ALL=C
export LC_ALL
# 再执行下面的语句,使之生效
source /etc/sysconfig/i18n
原文地址:http://blog.51cto.com/11310506/2102817