How To Set Locale In Linux? – POFTUT

How To Set Locale In Linux?

The locale is the configuration of a Linux system that provides a region, keyboard, time-related data. The locale is important because it will change the interpretation of some keyboards etc. If you are getting following warning like “Setting locale failed” we will look at how to solve it.

Locale error

Locale error

List Current Locale Setting

Listing of current locale settings can be done just issuing locale command. We do not need to provide an option for listing.

List Current Locale Setting

List Current Locale Setting

As we can see that there are different locale settings like TIME, ADDRESS , MEASUREMENT, MONETARY etc.

Change Local Variable

We see that LC_ALL environment variable is not set and the problem is that some application needs this locale to be set.

update-locale syntax

update-locale syntax

We will use update-locale command in order to change the current locale. We will also provide the locale we want to set which is en_US.UTF-8 in this example.

  • update-locale is a command which will update locale configuration
  • LC_ALL="en_US.UTF-8" is the locale variable we want to update

To effect the settings log out and log in for locale command.

Change Local Variable

Change Local Variable

LEARN MORE  "Perl warning Setting locale failed" Error and Solution In Linux

Leave a Reply

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