Solve the Problem of Ubuntu Locale configuration Cannot set LC_CTYPE

Source: Internet
Author: User

Solve the Problem of Ubuntu Locale configuration Cannot set LC_CTYPE

Error: locale: Cannot set LC_CTYPE to default locale: No such file or directory locale:

Regenerate all locale configurations

Step 1: configure the desired locale. The recommended method is to copy all locale supported by Ubuntu to your configuration file and edit it.

Cp/usr/share/i18n/SUPPORTED/var/lib/locales/supported. d/local

Vi/var/lib/locales/supported. d/local, use the dd command to delete and delete, leaving only the en _ series and zh _ series, or other locale

For example:
Root @ bkjia :~ # More/var/lib/locales/supported. d/local
En_US.UTF-8 UTF-8
Zh_CN.UTF-8 UTF-8

Rm/var/lib/locales/supported. d/en

Rm/var/lib/locales/supported. d/zh files have the same functions as local files. You can also write en series files and en series files in zh files for easy classification. Since I have written them in local, these two are useless.

Step 2: regenerate the locale support file

Locale-gen -- purge

The files supporting locale in/usr/lib/locale/are deleted and regenerated. If the configured locale is not generated, or the spelling is incorrect, No support file with the same name is found in the directory, and No such file is displayed.

Step 3: configure the locale environment.

Press locale to copy the environment variables output to/etc/default/locale and manually modify them.

For example:

Root @ bkjia :~ # More/etc/default/locale
LC_CTYPE = en_US.UTF-8
LC_NUMERIC = en_US.UTF-8
LC_TIME = en_US.UTF-8
LC_COLLATE = zh_CN.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 =
LANGUAGE = en_US: en
Ststst_id3_tag_encoding = GBK
LANG = en_US.UTF-8

The value that can be set is the value included in/var/lib/locales/supported. d/local, or the name of the folder generated in/usr/lib/locale.

Step 4: log out and log on again, and then tap locale to check whether the error is correct.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.