Linux locale missing and installed __linux

Source: Internet
Author: User
Tags i18n locale
the problems encountered:

1.-bash:warning:setlocale:lc_all:cannot change locale (En_us.utf8)


Locale-gen en_US. UTF-8

Update-local en_US. UTF-8

2.en_us. UTF-8. Cannot open Locale definition file ' translit_neutral ': No such file or directory


Copying files from another machine

3.locale-a appears:

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

But/usr/lib/locales does have a number of character sets.

Tried the

(1) rm-rf/usr/lib/locale/* (2) dpkg-reconfigure locales (3) Locale-gen (4) update-local wait, No.

Finally copy the/usr/share/i18n directory from another machine, the Execution (1) (3) problem disappears. Another point: Which locale determine whether the locale program in use is expected. Summary: 1. The new character library encoded information is located under the/usr/share/i18n directory, where supported contains the available character sets, which are in the following format:

zh_hk Big5-hkscs
zh_sg. UTF-8 UTF-8
Zh_sg. GBK GBK
zh_sg GB2312
zh_tw. EUC-TW euc-tw
zh_tw. UTF-8 UTF-8 ...
The mapping information for each character set stored in the charmaps can be called the original file (there may be a term, however many). Use Localedef to generate character sets, which are the locales inside. But these are not the characters that can be used in the system. The files in these/usr/share/i18n just described are only available in the set, locale-m can see the list. Since there are dozens of characters in the Linux character set, and most users can use more than one, there is no need to integrate all the character sets into the system. Only part of the character set is used inside the system. In addition, in order to allow the system to use, the original/usr/share/i18n documents to be processed (complile), can be used in the character encoding under/usr/lib/locale/, become the complied character set. 2. Using Locale-gen, you can complie the files in the original/usr/share/i18n into the/usr/lib/locale/character set that the system can use. The Locale-gen parameter is a list of character sets to use, which can be developed under the terminal. Otherwise it will be automatically searched under the./var/lib/locales/supported.d/. Compilation-generated character sets can exist in two ways: a.archive file:/usr/lib/locale/locale-archive B. Sub-directory storage. Refer to Man Locale-gen 3. /USR/SHARE/I18N inside the operating system is irrelevant, different architectures, different systems can be common, if there is a lack of replication from other places can be. Error:locale-gen en_US. UTF-8:en_US. UTF-8. Cannot open Locale definition file ' translit_neutral ': No such file or directory failed
en_US. UTF-8. Cannot open Locale definition file ' translit_combining ': No such file or directory
: Copy/usr/share/i18n/locales/transx from another machine to the local/usr/share/i18n/locales directory.

Useful Link:

Http:// all-to-default-locale-no-such-file-or-directory-218622/


Related Article

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: 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.