I have a problem with locale and I can't found any solution that works!
Every tutorial is similar to this: Perl warning Setting locale failed in Debian.
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 it?
Best Answer
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
anden_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:
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 theen_GB.UTF-8
locale, you need to have a line containingOnce you've edited
/etc/locale.gen
, runlocale-gen
to regenerate the locale definitions.The value
UTF-8
that you've set forLC_CTYPE
is invalid. You need to use a valid locale name, e.g.LC_CTYPE=en_GB.UTF-8
. You can leaveLC_CTYPE
unset: it'll default to the value ofLANG
. Though I rather recommend to leaveLANG
unset and setLC_CTYPE=en_GB.UTF-8
andLC_TIME=en_GB.UTF-8
(LC_MESSAGES
effectively defaults to English, if you were using another language then you should set it as well).