It's known that Perl complains loudly on starting up when it fails to find the compiled locale data in
/usr/lib/locale/locale-archive for the locale you specify in the environment variables (
LANG and others). It's easily reproducible like this:
$ LANG=xyz perl /dev/null
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_PAPER = "ja_JP.UTF-8",
LC_ADDRESS = "ja_JP.UTF-8",
LC_MONETARY = "ja_JP.UTF-8",
LC_NUMERIC = "ja_JP.UTF-8",
LC_TELEPHONE = "ja_JP.UTF-8",
LC_IDENTIFICATION = "ja_JP.UTF-8",
LC_MEASUREMENT = "ja_JP.UTF-8",
LC_TIME = "ja_JP.UTF-8",
LC_NAME = "ja_JP.UTF-8",
LANG = "xyz"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
So basically you should check available locales in the system and your locale settings in the environment variables when you see warnings above.
You can use
locale -a to see all available locales, or
localedef to list/add/delete compiled locales in
$ localedef --list-archive
locale-gen is a Debian specific wrapper script for
localedef with config file
dpkg-reconfigure locales updates
/etc/locale.gen then just calls
Note that Ubuntu has the same command
locale-gen, but its implementation seems quite different than Debian. It sees
/var/lib/locales/supported.d/ for config and
dpkg-reconfigure locales has no effect on Ubuntu. See also the community wiki instruction.
Locale related variables are set in your environment by various programs explicitly or implicitly. They would usually be initialized by
~/.pam_environment in the beginning of the session. More notably
ssh will automatically send local locale settings to remote host sessions per default in Debian/Ubuntu.
You can see the following line in
/etc/ssh/ssh_config, which is mentioned in
ssh_config manual page.
SendEnv LANG LC_*