您尚未登录。

#1 2013-06-02 18:30:01

if_else
会员
注册时间: 2012-11-04
帖子: 14

[ 已解决 ] locale 有问题: Warning: couldn't set locale.

各位兄台,

1. 打开终端提示这个问题:Warning: couldn't set locale.

我的 /etc/locale.conf:

LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8

执行 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=

locale -a 也报了这个问题:

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_COLLATE to default locale: No such file or directory
C
POSIX
zh_CN
zh_CN.gb18030
zh_CN.gb2312
zh_CN.gbk
zh_CN.utf8

执行程序的时候还会抛出这个错误:

$ rpws init 3 -k
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = (unset),
        LC_ALL = (unset),
        LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
gnew: group already exists
gnew: group already exists

请问这个是哪几个变量设置有问题?谢谢

最近编辑记录 if_else (2013-06-02 18:37:44)


#!  一个人的价值,应当看他贡献什么,而不是看他取得什么 ...

离线

#2 2013-06-02 18:37:03

if_else
会员
注册时间: 2012-11-04
帖子: 14

Re: [ 已解决 ] locale 有问题: Warning: couldn't set locale.

大意了,是 /etc/locale.gen 中忘记取消

en_US.UTF-8 UTF-8  
en_US ISO-8859-1

的注释了,取消注释后,重新执行 sudo locale-gen 更新 locale 后,恢复正常。


#!  一个人的价值,应当看他贡献什么,而不是看他取得什么 ...

离线

页脚