System Locales Change and Set in CentOS 7 and RHEL 7

In this tutorial we see step by step system locales change and set in CentSO 7 and RHEL 7. We will also know, What is system locales? So let’s start and first off all see what is system locales?

What is System Locale?

Locale is a set of environmental variables which defines the language, country, and character encoding settings for our applications and shell session on our Linux machine. These environmental variables are used by system libraries and locale-aware applications on the system.

Check Current System Locale Settings

We can check current locale settings with the help of localectl status command.

[root@urclouds ~]# localectl status
System Locale: LANG=en_US.UTF-8
VC Keymap: us
X11 Layout: us
[root@urclouds ~]#

Locale configuration file can be found in this path:- “cat /etc/locale.conf”

[root@urclouds ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"
[root@urclouds ~]#

List of All Available  Locales in CentOS 7 and RHEL 7

You must know that which locales are available on the current system, before changing the system locale. We can display locale list using below command. Like below:-

[root@urclouds ~]# localectl list-locales

If you want to select a EN_US locale, then you can list all EN_US locales by issue the following command:

[root@urclouds ~]# localectl list-locales | grep en_US
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
[root@urclouds ~]#

Change The System Locale

We have two option to change the system locale, first modify the configuration in this “/etc/locale.conf” file and second is “localectl” command which is newly added in CentOS 7 and RHEL 7.

We need to edit “/etc/locale.conf” file and search “LANG” line and change its value as what we want to select the locale. Such as: change locale to “en_us.iso88591”.

[root@urclouds ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"
[root@urclouds ~]#

Before:

LANG=es_US.utf8

After:

LANG=en_US.iso88591
[root@urclouds ~]# cat /etc/locale.conf
LANG="en_US.iso885915"
[root@urclouds ~]#

Save and exit the above configuration file and reboot the system, then this changes will be  effected.

Setting system locale via localectl command

To set the default system locale, we can use below command:

[root@urclouds ~]# localectl set-locale LANG=< locale name

Where we need to replace the locale name, which we want to select the locale. Like below:-
Changing the default locale to Eng locale, we need to run below command:-

[root@urclouds ~]# localectl set-locale LANG=en_US.utf8
[root@urclouds ~]#

Now we can verify current locale status and we will find our current local is “en_US.utf8”

[root@urclouds ~]# localectl status
System Locale: LANG=en_US.utf8
VC Keymap: us
X11 Layout: us
[root@urclouds ~]#

That’s all we have set and change the system locale setting in CentOS 7 and RHEL 7.

This Post Has 13 Comments

  1. Siobhan Hossain

    Really informative article.Really thank you! Want more.

  2. Stuart Dunegan

    You are a very clever person!

  3. Alease Whyte

    Hi there, You have performed an excellent job. I will certainly digg it and personally suggest to my friends. I’m confident they will be benefited from this site.|

  4. Moises Eun

    Great info and right to the point. I don’t know if this is in fact the best place to ask but do you guys have any thoughts on where to employ some professional writers? Thanks 🙂

  5. Cyrus Meserve

    It’s very straightforward to find out any matter on web as compared to books, as I foundthis piece of writing at this web page.

  6. Elenore Kakos

    Thanks for another informative web site. The place else could I get that type of information written in such an ideal means? I have a mission that I’m simply now operating on, and I’ve been on the glance out for such information.

  7. Hipolito Allstott

    Wow, incredible blog structure! How lengthy have you been running a blog for? you made blogging look easy. The whole glance of your website is wonderful, as well as the content material!

  8. Nelia Vittitoe

    What i don’t understood is in reality how you’re now not actually a lot more well-preferred than you might be now. You are very intelligent. You recognize therefore considerably when it comes to this topic, produced me in my view consider it from so many numerous angles. Its like women and men are not involved until it is something to do with Lady gaga! Your personal stuffs outstanding. All the time deal with it up!

  9. https://is.gd/

    I’m really enjoying the design and layout of your website.
    It’s a very easy on the eyes which makes it much more pleasant for me to come
    here and visit more often. Did you hire out a developer to create
    your theme? Outstanding work!

    1. Zafar

      Hi Dear,

      No I have created this site myself.
      Thanks for your visit on my site and your great appreciation.

      Best Regards
      Zafar

  10. Lakseolie til hund

    Thanks-a-mundo for the article post.

  11. http://tinyurl.com/quest-bars-cheap-8889

    Hey there would you mind letting me know which web host you’re utilizing?
    I’ve loaded your blog in 3 completely different web browsers and I must say this blog loads a lot quicker then most.

    Can you suggest a good internet hosting provider at a reasonable price?

    Thanks, I appreciate it!

  12. Verlene Chernoff

    I really appreciate your help with my project!

Leave a Reply