Fix: setting locale failed
Many package installations fail with the following errors. Especially the ones which involve databases etc. I found this following error while getting postgres SQL work.
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.UTF-8″
are supported and installed on your system.
perl: warning: Falling back to the standard locale (“C”).
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
or you might even this error
Error: The locale requested by the environment is invalid.
This can be easily sorted out by running following command to generate the required locales.
You can even specify the locale with this command to generated the correct locale required for installations as follows:
locale-gen en_US.UTF-8
Here is how I generated en_US locale:
~# locale-gen en_US
Generating locales…
en_US.ISO-8859-1… done
Generation complete.
Enjoy!
Tags: en_US, en_US.UTF-8, locale, locale-gen, openbravo, Ubuntu
Recent Comments