We’ll show you how to set up system locale on CentOS 7. System locale allows you to specify the language settings for the user interfaces and services running on your system.
How can you change it in CentOS 7? In this tutorial, you will learn how to set up system-wide locale settings on a Linux VPS running CentOS 7 as the operating system.
First of all, let’s learn more about the system locale. The system-wide locale settings are stored in a file. The file is /etc/locale.conf and this file is read by the systemd daemon at system boot. All the settings specified in this file are inherited by the users on your system and the services running on your system. However, certain system users or services can easily override the specified system locale settings if needed.
Connect to your CentOS VPS via SSH and update your system software to the latest version available before doing anything else. Issue the following command to do that:
The update process should take no longer than a few minutes to complete. Once it completes, run the following command to check the system locale specified on your server:
You should see something like the following:
You can check the system locale specified on your CentOS VPS by reading the /etc/locale.conf file too:
If you want to set up a different system locale on your system you can do that by using the localectl command. First, list the available locales:
The list should be very long. If you want to filter the English locales you can do that using the command below:
You should get something like the following:
To set up a specific system locale to be a default one, you can use the localectl command:
The syntax is the following:
Of course, you need to replace locale_name with the default locale you like to set. For example, if you’d like to set en_GB.utf8 as a default system locale you can use the command below:
To check if everything is OK you can run the following command again:
Now, the output should be the same like the following:
Using localectl you can set up virtual console keyboard mappings on your system too. For more information about what options are available you can use the –help flag:
The output of the command above should be similar to the following one:
See Also: How to Set Up System Locale on Ubuntu 16.04
Of course, you don’t have to set up system locale on CentOS 7, if you use one of our Managed CentOS VPS hosting services, in which case you can simply ask our expert Linux admins to set up the system locale for you. They are available 24×7 and will take care of your request immediately.
If you liked this post, on how to set up system locale on CentOS 7, please share it with your friends on social networks or simply leave a reply below. Thanks.
Hi,
I have a problem, my files are with “charset” equal to “binary”, see:
https://i.imgur.com/M5jQCHm.png
I followed all the steps of your tutorial but I could not figure it out. Do you have any idea how I can solve it?
Can you please be more specific about this and tell us what exactly are you trying to achieve?
My locale is setup as follows:
# localectl status
System Locale: LANG=en_NG
VC Keymap: us
X11 Layout: n/a
But every time I do yum update I get the following error message;
Loaded plugins: fastestmirror, langpacks, universal-hooks
Options error: unknown locale: en_NG
How can I solve this