(問題解決)Cannot set LC_CTYPE to default locale: No such file or directory

尛樣兒發表於2010-01-31

環境:
[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了一下找到一篇文章
發現是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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章