CentOS 7/rhel 7:how To change the System Locale

Source: Internet
Author: User

The system Localeare used to control the language setting of system services and the UI before the user logs in. How does I change the default system locale in the CentOS 7 Linux system? How to check the current locate setting under CentOS 7 or RHEL 7 ? How do I get the list of all available locales on the current Linux system? The This post, you'll see, how to set the system locale.

CentOS 7/rhel 7 Check current System Locale Settings

To show the current locale settings, you can view the "/etc/locale.conf" configuration file via "cat/etc/locale.conf" com Mand or issue the following "Localectl status" command.

1

2

3

Cat/etc/locale.conf

OR

Localectl status

Output:

1

2

3

4

5

6

[root @ devops ~] # cat/etc/locale.conf

LANG =es_us.utf8

[root @ devops ~] # LOCALECTL Status

System Locale:lang =es_us.utf8

VC Keymap:us

X11 Layout:us

CentOS 7/rhel 7 List all Available Locales

Before changing the system locale, you must know that which locales is available on the current system, issue the FOLLOWI ng command:

Localectl List-locales

Example:if want to select a en_US locale and then you can list all en_US locales by issue the following command:

Localectl List-locales | grep en_US

Outputs:

1

2

3

4

5

[root @ devops ~] # localectl List-locales | grep en_US

en_US

en_us.iso88591

en_us.iso885915

En_us.utf8

CentOS 7/rhel Change the System Locale

There is ways to change the system locale by through modifying the "/etc/locale.conf" configuration file or using a N EW command "Localect" which is newly added in CentOS 7 or RHEL 7 operating system.

Edit "/etc/locale.conf" file using "Vim" command and "search" LANG "line and" it value as "What do you want to select th E locale. Such as:change locale to "en_us.iso88591″.vim/etc/locale.conf

Before:

LANG =es_us.utf8

After:

LANG =en_us.iso88591

Save and exit the above configuration file and reboot the system, then the changes would take effect.

# Set the system locale via LOCALECTL command

To set the default system locale and you can use the following command:

Localectl Set-locale LANG = < locale name >

You need to replace the locale name as your want to select the locale.

Example:changing The default locale to German locale, issue the following command:

Localectl Set-locale LANG =de_de. UTF-8

Outputs:

1

2

3

4

5

[root @ devops ~] # localectl Set-locale lang=de_de. UTF-8

[root @ devops ~] # LOCALECTL Status

System Locale:lang =de_de. UTF-8

VC Keymap:us

X11 Layout:us

Note:you must log on the system with root user to run Localectl command.

CentOS 7/rhel 7:how To change the System Locale

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.