How to solve the error of "locale: cannot set LC_CTYPE to default locale: No such file or directory" and similar?
If you got this error, that means the environmental variable (in this case, it is LC_CTYPE) does not contain a reconganizable locale your system knows. This may be caused by two possibilities:
1. The locale you set to LC_CTYPE is misspelled;
2. The locale you specified is not installed in your system, in order to find out whether this is the case, do a
SmallBox:/etc# 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
SmallBox :/etc# 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_ZA
LC_CTYPE="en_ZA"
LC_NUMERIC="en_ZA"
LC_TIME="en_ZA"
LC_COLLATE="en_ZA"
LC_MONETARY="en_ZA"
LC_MESSAGES="en_ZA"
LC_PAPER="en_ZA"
LC_NAME="en_ZA"
LC_ADDRESS="en_ZA"
LC_TELEPHONE="en_ZA"
LC_MEASUREMENT="en_ZA"
LC_IDENTIFICATION="en_ZA"
LC_ALL=en_ZA
heyunhuan:/etc# 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
And see whether the locale you specified is contained in the output of that command. If it can not be found in the output, then you have to install that locale. Please refer to the doc about how to configure SCIM.
Step1. SmallBox:/etc# apt-get update
Step2. SmallBox:/etc# apt-get install locales
This problem will be solve!!!
Author: Small.Box
Time: 2008.07.02 08:49am
System: Debian /Linux Kernel 2.6.18
Address: Dalian China
If you got this error, that means the environmental variable (in this case, it is LC_CTYPE) does not contain a reconganizable locale your system knows. This may be caused by two possibilities:
1. The locale you set to LC_CTYPE is misspelled;
2. The locale you specified is not installed in your system, in order to find out whether this is the case, do a
SmallBox:/etc# 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
SmallBox :/etc# 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_ZA
LC_CTYPE="en_ZA"
LC_NUMERIC="en_ZA"
LC_TIME="en_ZA"
LC_COLLATE="en_ZA"
LC_MONETARY="en_ZA"
LC_MESSAGES="en_ZA"
LC_PAPER="en_ZA"
LC_NAME="en_ZA"
LC_ADDRESS="en_ZA"
LC_TELEPHONE="en_ZA"
LC_MEASUREMENT="en_ZA"
LC_IDENTIFICATION="en_ZA"
LC_ALL=en_ZA
heyunhuan:/etc# 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
And see whether the locale you specified is contained in the output of that command. If it can not be found in the output, then you have to install that locale. Please refer to the doc about how to configure SCIM.
Step1. SmallBox:/etc# apt-get update
Step2. SmallBox:/etc# apt-get install locales
This problem will be solve!!!
Author: Small.Box
Time: 2008.07.02 08:49am
System: Debian /Linux Kernel 2.6.18
Address: Dalian China
本文介绍了解决Linux系统中locale设置错误的方法,特别是当遇到locale: 无法将LC_CTYPE 设置为默认locale: 没有该文件或目录这类问题时的处理步骤。首先检查locale设置是否正确拼写,并确认所需的locale已安装。通过运行命令`locale -a`来查看已安装的locale列表,并使用`locale`命令验证当前设置。如果指定的locale不存在,则需通过运行`apt-get update`和`apt-get install locales`来安装。
4666

被折叠的 条评论
为什么被折叠?



