Configure Locales in Ubuntu
Locales (language settings) can be configured for Ubuntu from the command line. This guide is applicable to Ubuntu 11.10 and provides steps for displaying current settings, available locales, and adjusting locales as needed.
Displaying the Current Settings
You can check the current locale settings using the locale
command:
|
|
This output displays the current locale settings for various aspects of the system.
Displaying the Available Locales
To see a list of available locales, use the locale -a
command:
|
|
If a required locale doesn’t appear in the list, you may need to install it. For example, to generate the fr_FR.UTF-8
locale, you can use the locale-gen
command:
|
|
Adjusting Locales
Locale settings are stored in the /etc/default/locale
file. You can view the current settings using the cat
command:
|
|
To manually adjust these settings, you can edit the /etc/default/locale
file. Alternatively, you can use the update-locale
tool. For example, to set the system’s language to German (de_DE.UTF-8
), you can use:
|
|
This tool is particularly useful when you want the system to operate in one language (e.g., German) but display error and system messages in another language (e.g., English). To achieve this, you can modify /etc/default/locale
or /etc/environment
like this:
|
|
By configuring locales in Ubuntu, you can customize the language settings to suit your preferences and requirements.