5

I have a problem with locale and I can't found any solution that work !

Every tutorial are similar like this: http://www.thomas-krenn.com/en/wiki/Perl_warning_Setting_locale_failed_in_Debian

So, this is the problem with locale:

pi @ server [~]:
$ > sudo deluser --remove-home cm22
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_GB.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Looking for files to backup/remove ...
Removing user `cm22' ...
Warning: group `cm22' has no more members.
Done.

How can I resolve ? thank you

  • Can you post the output of locale, locale -a and env | grep -e LANG -e LC_? – Stéphane Chazelas Nov 20 '14 at 13:04
  • The output is: pi @ server [~]: $ > locale -a and env | grep -e LANG -e LC_? locale: Cannot set LC_CTYPE to default locale: No such file or directory – anerdev Nov 20 '14 at 19:26
8

Debian saves network bandwidth by shipping locale definitions in a form that isn't directly usable, where information that is shared between locales (e.g. en_US and en_CA are very similar) is stored in a single file. Usable locale definitions must be generated on each machine. To save CPU time and disk space, only locales requested by the system administrator are generated.

Run the following command as root to configure the set of locales to generate:

dpkg-reconfigure locales

Alternatively, edit the file /etc/locale.gen and comment out the lines corresponding to the locales you want (lines beginning with # are comment lines). For example, if you want the en_GB.UTF-8 locale, you need to have a line containing

en_GB.UTF-8 UTF-8

Once you've edited /etc/locale.gen, run locale-gen to regenerate the locale definitions.

The value UTF-8 that you've set for LC_CTYPE is invalid. You need to use a valid locale name, e.g. LC_CTYPE=en_GB.UTF-8. You can leave LC_CTYPE unset: it'll default to the value of LANG. Though I rather recommend to leave LANG unset and set LC_CTYPE=en_GB.UTF-8 and LC_TIME=en_GB.UTF-8 (LC_MESSAGES effectively defaults to English, if you were using another language then you should set it as well).

  • I change /etc/locale.gen. But how set LC_CTYPE ? Thank you – anerdev Dec 3 '14 at 19:16
  • 1
    @anerdev Edit whichever file has the bad definition of LC_TYPE to fix it. It could be in your home directory or under /etc. Try grep -s LC_CTYPE ~/.* || grep -rs LC_CTYPE /etc to find it. – Gilles Dec 11 '14 at 23:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.