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.

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

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

[[email protected] ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"
[[email protected] ~]#

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

[[email protected] ~]# 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:

[[email protected] ~]# localectl list-locales | grep en_US
en_US
en_US.iso88591
en_US.iso885915
en_US.utf8
[[email protected] ~]#

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

[[email protected] ~]# cat /etc/locale.conf
LANG="en_US.UTF-8"
[[email protected] ~]#

Before:

LANG=es_US.utf8

After:

LANG=en_US.iso88591
[[email protected] ~]# cat /etc/locale.conf
LANG="en_US.iso885915"
[[email protected] ~]#

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:

[[email protected] ~]# 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:-

[[email protected] ~]# localectl set-locale LANG=en_US.utf8
[[email protected] ~]#

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

[[email protected] ~]# localectl status
System Locale: LANG=en_US.utf8
VC Keymap: us
X11 Layout: us
[[email protected] ~]#

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

12 thoughts on “System Locales Change and Set in CentOS 7 and RHEL 7

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

  2. 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 🙂

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

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

  5. 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!

  6. 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!

  7. 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. Hi Dear,

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

      Best Regards
      Zafar

  8. 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!

Leave a Reply

Your email address will not be published. Required fields are marked *