How to change locale settings

From RCSWiki
Jump to navigation Jump to search

Background

In computing, a locale is a set of parameters that defines the user's language, region and any special variant preferences, that the user wants to see in their user interface. Usually a locale identifier consists of at least a language code and a country/region code.

For example, a locale setting for your computing environment will affect the presence of special characters, sorting order, as well as some other values, such as the currency symbol.

The Issue

It is convenient to have the locale of your computer set to your preferred value. However, when you use your SSH client to connect to a remote computer, such as the ARC cluster, the SSH client will translate your locale settings to your remote session on the remote computer. It will set the current locale to the value you have on your personal computer. The problem will arise if such a locale is not available on the remote computer.


In addition, the compute nodes in ARC have less software and tools installed in their environment, to save space. Thus, even though the locale your SSH client sets, may be available on ARC's login node, it may not be available on the compute nodes.


If the locale that was communicated and set by your SSH client is not available on the remote system, it will show itself when a locale aware program starts. The system will be printing annoying warnings.

For, example, when starting an interactive R session:

$ R
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (CA.UTF-8)

R version 4.2.0 (2022-04-22) -- "Vigorous Calisthenics"
....
....

sh: warning: setlocale: LC_ALL: cannot change locale (CA.UTF-8)
sh: warning: setlocale: LC_ALL: cannot change locale (CA.UTF-8)
During startup - Warning messages:
1: Setting LC_CTYPE failed, using "C" 
2: Setting LC_COLLATE failed, using "C" 
3: Setting LC_TIME failed, using "C" 
4: Setting LC_MESSAGES failed, using "C" 
5: Setting LC_MONETARY failed, using "C" 
6: Setting LC_PAPER failed, using "C" 
7: Setting LC_MEASUREMENT failed, using "C" 
>

Links

How-Tos