89291843 2011-08-19
$sudoapt-getinstalllocales
$sudodpkg-reconfigurelocales
选择相关的
$locale
时间有点常,耐心等待一会,然后重启,便可以成功。
参考帖子:
http://hi.baidu.com/%B7%D7%E7%A1/blog/item/122efb0377e30e7a3812bb5e.html
在debian下安装程序时,有时候会因为本地设置没有设置好,Per会给出下面的错误提示:
perl:warning:Settinglocalefailed.
perl:warning:Pleasecheckthatyourlocalesettings:
LANGUAGE=(unset),
LC_ALL=(unset),
LANG="zh_CN.UTF-8"
aresupportedandinstalledonyoursystem.
perl:warning:Fallingbacktothestandardlocale("C").
locale:CannotsetLC_CTYPEtodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_MESSAGEStodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_ALLtodefaultlocale:Nosuchfileordirectory
要解决这个问题,其实很简单,只要执行下面几条命令,一切都会OK:
debian:~#apt-getinstalllocales
debian:~#dpkg-reconfigurelocales
debian:~#locale
下面是我执行这几条命令的显示(粗体部分是命令行):
debian:~#apt-getinstalllocales
Readingpackagelists...Done
Buildingdependencytree...Done
ThefollowingNEWpackageswillbeinstalled:
locales
0upgraded,1newlyinstalled,0toremoveand9notupgraded.
Needtoget3967kBofarchives.
Afterunpacking9612kBofadditionaldiskspacewillbeused.
Get:1http://debian.cn99.comstable/mainlocales2.3.6.ds1-13etch2[3967kB]
Fetched3967kBin1s(3106kB/s)
perl:warning:Settinglocalefailed.
perl:warning:Pleasecheckthatyourlocalesettings:
LANGUAGE=(unset),
LC_ALL=(unset),
LANG="zh_CN.UTF-8"
aresupportedandinstalledonyoursystem.
perl:warning:Fallingbacktothestandardlocale("C").
locale:CannotsetLC_CTYPEtodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_MESSAGEStodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_ALLtodefaultlocale:Nosuchfileordirectory
Preconfiguringpackages...
Selectingpreviouslydeselectedpackagelocales.
(Readingdatabase...9213filesanddirectoriescurrentlyinstalled.)
Unpackinglocales(from.../locales_2.3.6.ds1-13etch2_all.deb)...
Settinguplocales(2.3.6.ds1-13etch2)...
perl:warning:Settinglocalefailed.
perl:warning:Pleasecheckthatyourlocalesettings:
LANGUAGE=(unset),
LC_ALL=(unset),
LANG="zh_CN.UTF-8"
aresupportedandinstalledonyoursystem.
perl:warning:Fallingbacktothestandardlocale("C").
locale:CannotsetLC_CTYPEtodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_MESSAGEStodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_ALLtodefaultlocale:Nosuchfileordirectory
debian:~#dpkg-reconfigurelocales
perl:warning:Settinglocalefailed.
perl:warning:Pleasecheckthatyourlocalesettings:
LANGUAGE=(unset),
LC_ALL=(unset),
LANG="zh_CN.UTF-8"
aresupportedandinstalledonyoursystem.
perl:warning:Fallingbacktothestandardlocale("C").
locale:CannotsetLC_CTYPEtodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_MESSAGEStodefaultlocale:Nosuchfileordirectory
locale:CannotsetLC_ALLtodefaultlocale:Nosuchfileordirectory
/usr/bin/locale:CannotsetLC_CTYPEtodefaultlocale:Nosuchfileordirectory
/usr/bin/locale:CannotsetLC_MESSAGEStodefaultlocale:Nosuchfileordirectory
/usr/bin/locale:CannotsetLC_ALLtodefaultlocale:Nosuchfileordirectory
Generatinglocales(thismighttakeawhile)...
en_US.ISO-8859-1...done
en_US.ISO-8859-15...done
en_US.UTF-8...done
zh_CN.GB2312...done
zh_CN.GB18030...done
zh_CN.GBK...done
zh_CN.UTF-8...done
zh_HK.BIG5-HKSCS...done
zh_HK.UTF-8...done
zh_SG.GB2312...done
zh_SG.GBK...done
zh_SG.UTF-8...done
zh_TW.BIG5...done
zh_TW.EUC-TW...done
zh_TW.UTF-8...done
zu_ZA.ISO-8859-1...done
zu_ZA.UTF-8...done
Generationcomplete.
debian:~#locale
LANG=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=
debian:~#
在执行第二条命令时,按照提示,选择你想要的local就OK了。
第三条命令是用来查看都安装了哪些local。
如果还不行,需要把LC_ALL=设置成zh_CN.UTF-8