代码: 全选
perl: warning: Falling back to the standard locale ("C"). locale: Cannot set LC_CTYPE to default locale: No such file or directory locale: Cannot set LC_ALL to default locale: No such file or directory
代码: 全选
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER="zh_CN.UTF-8"
LC_NAME="zh_CN.UTF-8"
LC_ADDRESS="zh_CN.UTF-8"
LC_TELEPHONE="zh_CN.UTF-8"
LC_MEASUREMENT="zh_CN.UTF-8"
LC_IDENTIFICATION="zh_CN.UTF-8"
LC_ALL=
用localedef生成locale文件也不行,后来搜索到locale-gen,用那个命令也没有效果,试图用sudo apt-get remove locales先删除再重装时,提示包损坏,执行sudo dpkg-reconfigure locales也是这样。看了ee的帖子后才想起到packages.ubuntu.org上去下载libc6安装包。先是下载的dapper版的 libc6_2.3.6-0ubuntu20_i386.deb,下载安装后,locale显示正常了,不提示 locale: Cannot set LC_ALL to default locale: No such file or directory错误了,但没想到运行gedit时提示没有glibc2.4之类的。于是再次下载libc6的Edgy的版本libc6_2.4-1ubuntu12_i386.deb,这次locale又出现错误了.但这里我想到了既然是libc6版本降级可以使locale正常,那在libc62.4版的情况下,把locale的版本升级一下不就可以了吗?于是再次下载locale的edgy版本 locales_2.3.22_all.deb,并根据依赖提示,下载安装了tzdata_2006m-1ubuntu1_all.deb和belocs -locales-bin_2.4-1ubuntu6_i386.deb。这进安装locale新版本后,终于locale的输出正常了。重起,变成中文了。
解决。
如果有朋友和我一样,也是包损坏,可以用这个方法试试。