Cannot set LC_CTYPE to default locale:no such file or directory error resolution is changed by default language Lang after the Ubuntu installation is complete

Source: Internet
Author: User
Tags locale svn client

Address: http://blog.csdn.net/feihong247/article/details/7767889


When you installed Ubuntu, you chose Chinese, but later found that the SVN client needed UTF8 to support Chinese.

So modify/etc/default/locale as:

Lang= "en_US. UTF-8 "
Language= "En_us:en"

But then, Perl, Locale,export Lang=en_us. Commands like UTF-8 appear warning:

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

Solution:

Locale-gen en_US. UTF-8







If Ubuntu server is in the process of installation, choose Chinese (many beginners will choose to install the Chinese, easy to use), so that after the installation, the system default language will be Chinese zh_cn. UTF-8. But the problem is that we installed the server, only need to run the command line terminal, but in the terminal does not normally display the default Chinese encoding zh_cn. UTF-8.

There are three ways to solve the problem, which are described in detail below.

First: Install the Zhcon package
$ sudo apt-get install Zhcon
Can be installed on the Zhcon package, it is actually equivalent to an Ubuntu Uc-dos program, is a Chinese character plug-in. Since the plug-in is bound to occupy a certain amount of system resources, according to the actual demand can choose this method.

The second: The use of putty, SECURTECRT and other virtual terminal software
Modify the font encoding in the virtual Terminal interface configuration project directly to UTF-8. In fact, the Ubuntu server default ZH_CN is still in use. UTF-8 encoding, but in the virtual terminal after the "code correction" after the correct display, because the Windows system is using GBK as the system default code, so under Windows, whether it is virtual machine, or the default virtual terminal interface, display Chinese characters are garbled or diamond-shaped symbols. This method is used widely, but it still can't display Chinese characters normally under the actual terminal, because the default encoding of the system is still ZH_CN. UTF-8, the actual terminal on the server still cannot know ZH_CN. UTF-8 this encoding. So it leads to a third method.

Third: Modify Ubuntu's configuration file/etc/default/locale
Change the original configuration content to
Lang= "en_US. Utf-8″
Language= "En_us:en"
Then run under the terminal:
$ locale-gen-en_us:en
After you log off or restart, the Ubuntu server real Servers entity terminal is restored to the English language environment.
So, this approach is not really a Chinese culture, but a restore of the English default encoding

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.