Locale in CentOS

To compile a locale in CentOS, do something like this:

root# localedef -c -f UTF-8 -i en_US en_US.utf8

To see all locales available, do this:

$ locale -a

To set locale, do something like this:

$ export LANG=en_US.UTF-8

 

Comments

How to set it for the whole system?

When we do these commands, the locale are set for the current console only.

How can we set the locale for the whole system and to have those values when I log on my system?

/etc/profile

You can add those commands in /etc/profile.