当我运行perl时,我得到警告:

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").

我该怎么解决呢?


当前回答

如果您正在使用反引导创建rootfs,则需要生成区域设置。你可以通过运行:

# (optional) enable missing locales
sudo nano /etc/locale.gen

# then regenerate
sudo locale-gen

这个技巧来自https://help.ubuntu.com/community/Xen

其他回答

前面的答案都是错的。消息是明确的-缺少区域设置。解决方案是添加适当的区域设置。您可以通过编辑/etc/locale.生成文件,删除被报告为缺失的地区前面的#符号,然后发出命令:

$ sudo locale-gen

这将实际生成在/etc/locale.中指定的地区Gen,因此消息将不会显示。

在我的情况下,使用Debian 8.6 (Jessie),我必须更改设置:

/etc/ssh/ssh_config` for `#AcceptEnv LANG LC_*

and

sshd_config为SendEnv LANG LC_*

然后重新启动ssh服务。

最后,我做到了:

locale-gen en_US。UTF-8和dpkg-reconfigure区域设置

perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_ALL to default locale: No such file or directory

解决方案:

试试这个(uk_UA。UTF-8是我当前的语言环境。编写语言环境,例如en_US。utf - 8 !)

sudo locale-gen uk_UA.UTF-8

这。

sudo dpkg-reconfigure locales

以下是接受的答案:

LANG=C ssh hunter2。

LC_ALL=C ssh hunter2

在客户端,我成功了。

如果您在CentOS中运行chroot,请尝试手动将有此问题的帐户的/usr/lib/locale复制到chroot环境。