CentOS6.5手动安装glibc-2.14后出现setlocale: LC_CTYPE: cannot change locale (UTF-8):No such file or directory解决办法

最近遇到一个问题,每次登陆服务器,都会报一堆错误

-bash: warning: setlocale: LC_CTYPE: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (zh_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (zh_US.UTF-8): No such file or directory

网上搜了各种方法,基本上都是让修改各种locale文件,比如/etc/sysconfig/i18n什么的,但是都没有解决。
最后静下来想一想最近动了什么东西,发现好像就是更新了glibc,赶紧去搜一下,结果发现了一篇对症的文章。CentOS6.5手动安装glibc-2.14后locale出现No such file or directory终极解决办法
真是感谢作者,让我一下子快乐起来。
基本上意思就是更新了glibc-2.14导致系统去glibc-2.14目录去找locale文件,结果没找到导致的。
解决方法:

cp /usr/lib/locale/locale-archive /usr/local/glibc-2.14/lib/locale/locale-archive
/usr/local/glibc-2.14是你的glibc的安装目录,如果目录../glibc-2.14/lib/locale不存在,就先新建一个locale目录

elina
27 声望3 粉丝

引用和评论

0 条评论