关闭

-bash: warning: setlocale: LC_CTYPE: cannot change locale (EN_US.UTF-8)

标签: fileloginvimbashlinux语言
24894人阅读 评论(0) 收藏 举报
分类:
-bash: warning: setlocale: LC_CTYPE: cannot change locale (EN_US.UTF-8)

把linux系统从中文设置英文字符集后发生以下报错

首先本系统字符集为中文UTF-8

[root@localhost ~]# more  /etc/sysconfig/i18n 
LANG="zh_CN.UTF-8"

修改为英文UTF-8
[root@localhost ~]# vim  /etc/sysconfig/i18n 
LANG="EN_US.UTF-8"

source生效
[root@localhost ~]# source   /etc/sysconfig/i18n 
LANG="EN_US.UTF-8"

用secureCRT登陆后报以下错误

Last login: Sat Oct 20 11:35:03 2012 from 162.16.16.144
-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


重新修改为英文UTF-8字符集en为小写

[root@localhost ~]# vim  /etc/sysconfig/i18n 
LANG="en_US.UTF-8"

source生效
[root@localhost ~]# source   /etc/sysconfig/i18n 
LANG="en_US.UTF-8"

用secureCRT登陆,错误消失,看来是大小写的错误造成的找不到语言环境

[root@localhost ~]# 
Last login: Sat Oct 20 11:35:03 2012 from 162.16.16.144

执行locale命令可以看出错误所在

[root@localhost ~]# locale
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=

6
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:790567次
    • 积分:8846
    • 等级:
    • 排名:第2456名
    • 原创:137篇
    • 转载:45篇
    • 译文:9篇
    • 评论:43条
    简介
    此博客为笔者的DT工作记录,欢迎一起交流学习工作中的点滴,若博客文章观点存在原理的错误、纰漏,笔者非常欢迎各位不保留地指出
    最新评论