(问题解决)Cannot set LC_CTYPE to default locale: No such file or directory

环境:
[root@blliu Server]# more /etc/issue
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
[root@blliu Server]# uname -a
Linux blliu 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

错误描述:
[root@blliu Server]#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=en_US.UTF-8

网上google了一下找到一篇文章http://www.ixpub.net/thread-933658-1-1.html
发现是glibc-common包没有安装,找来x86_64的安装盘安装此包:
[root@blliu Server]# rpm -ivh glibc-common-2.5-42.x86_64.rpm
warning: glibc-common-2.5-42.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:glibc-common           ########################################### [100%]
error: unpacking of archive failed on file /usr/lib/locale/zh_TW/LC_COLLATE;4b653625: cpio: MD5 sum mismatch

发现安装不上。

于是又上网google,找到类似问题,有的说是文件不完整,于是找来i386的光盘来安装glibc-common包:

[root@blliu Server]# rpm -ivh glibc-common-2.5-42.i386.rpm
warning: glibc-common-2.5-42.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:glibc-common           ########################################### [100%]
[root@blliu Server]# locale
LANG=zh_CN.gb2312
LC_CTYPE="zh_CN.gb2312"
LC_NUMERIC="zh_CN.gb2312"
LC_TIME="zh_CN.gb2312"
LC_COLLATE="zh_CN.gb2312"
LC_MONETARY="zh_CN.gb2312"
LC_MESSAGES="zh_CN.gb2312"
LC_PAPER="zh_CN.gb2312"
LC_NAME="zh_CN.gb2312"
LC_ADDRESS="zh_CN.gb2312"
LC_TELEPHONE="zh_CN.gb2312"
LC_MEASUREMENT="zh_CN.gb2312"
LC_IDENTIFICATION="zh_CN.gb2312"
LC_ALL=zh_CN.gb2312

问题解决!

还参考了如下文章:http://hi.baidu.com/edeed/blog/item/2e99a14440bd8884b2b7dcb1.html

--over--

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23135684/viewspace-626490/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/23135684/viewspace-626490/

你可能感兴趣的:(移动开发)