Adjust and change the ubuntu time zone, time, locale

Source: Internet
Author: User
Tags locale setting
Adjust and change the ubuntu time zone, time, locale, and time (1) execute tzselect to select the time zone echo & quot; TZ & amp; #39; Asia/Harbin & amp; #39; exportTZ & quot; & gt ;~ /. Profile (2) sudocp/usr/share/zoneinfo/Asia/change ubuntu time zone, time, locale change time zone, time (1) execute tzselect and select the time zone echo "TZ = 'Asia/Harbin'; export TZ" >> ~ /. Profile (2) sudo cp/usr/share/zoneinfo/Asia/ShangHai/etc/localtime run sudo ntpdate cn.pool.ntp.orgcn.pool.ntp.org is a public NTP server located in China, used to synchronize your time setting date sudo date-s 20130413 change locale modify/var/lib/locales/supported. d/local for example: en_US.UTF-8 UTF-8 zh_CN.UTF-8 UTF-8 zh_CN.GBK GBK zh_CN GB2312 and then run locale-gen on it. Or how does sudo dpkg-reconfigure locales set locale? Setting locale is to set the locale classification attributes of 12 categories, that is, 12 LC _*. In addition to setting these 12 variables, there are two variables for convenience: LC_ALL and LANG. There is a relationship between them with a priority: LC_ALL> LC _ *> LANG. LC_ALL is set at the upper level or forcibly, while LANG is the default value. 1. if you set LC_ALL = zh_CN.UTF-8, then no matter what the LC _ * and LANG are set to, they will be forced to obey the LC_ALL settings, become a zh_CN.UTF-8. 2. if you set LANG = zh_CN.UTF-8, and other LC _ * = en_US.UTF-8, and no LC_ALL is set, then the locale of the system is set to LC _ * = en_US.UTF-8. 3. if you set LANG = zh_CN.UTF-8, and other LC _ *, and LC_ALL are not set, the system will set LC _ * to the default value, that is, the LANG value zh_CN.UTF-8. 4. if you set LANG = zh_CN.UTF-8, and other LC_CTYPE = en_US.UTF-8, other LC _ *, and LC_ALL are not set, then the locale setting of the system will be: LC_CTYPE = en_US.UTF-8, the other LC_COLLATE, LC_MESSAGES and so on will use the default value, that is, the LANG value, that is, LC_COLLATE = LC_MESSAGES = ...... = LC_PAPER = LANG = zh_CN.UTF-8. Therefore, locale is set as follows: 1. if you need a Chinese-only system, you can set LC_ALL = zh_CN.XXXX or LANG = zh_CN.XXXX. of course, you can set both, but as mentioned above, the value of LC_ALL will overwrite all other locale settings, so do not useless work. 2. if you only want to enter a Chinese environment and keep the menu, title, and system information as the English interface, you only need to set LC_CTYPE = zh_CN.XXXX, LANG = en_US.XXXX. In this way, LC_CTYPE = zh_CN.XXXX, while LC_COLLATE = LC_MESSAGES = ...... = LC_PAPER = LANG = en_US.XXXX.
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: 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.