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 ~]#
Really informative article.Really thank you! Want more.
You are a very clever person!
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.|
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 🙂
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.
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.
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!
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!
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!
Hi Dear,
No I have created this site myself.
Thanks for your visit on my site and your great appreciation.
Best Regards
Zafar
Thanks-a-mundo for the article post.
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!
I really appreciate your help with my project!