linux各种locale问题的解决

玩linux时非常讨厌诸如以下的提示
引用
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:


侦测问题时先测试
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
LANGUAGE=en_US:en


则说明en_US的语言包没装好,尝试
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales


如果需要中文的locale
locale-gen zh_CN.UTF-8


另外,服务器上最好使用英文语言
vim /etc/default/locale 
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"

猜你喜欢

转载自luozhaoyu.iteye.com/blog/2003431