perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_TIME = "zh_CN.UTF-8", LC_MONETARY = "zh_CN.UTF-8", LC_ADDRESS = "zh_CN.UTF-8", LC_TELEPHONE = "zh_CN.UTF-8", LC_NAME = "zh_CN.UTF-8", LC_MEASUREMENT = "zh_CN.UTF-8", LC_IDENTIFICATION = "zh_CN.UTF-8", LC_NUMERIC = "zh_CN.UTF-8", LC_PAPER = "zh_CN.UTF-8", LANG = "en_US.UTF-8" are supported and installed on your system. perl: warning: Falling back to the standard locale ("C").
安装软件时,都会去执行 update-locale
命令,用来更新 locale。这个命令是 perl 脚本(能够用 whereis update-locale
查到)ssh
上述警告并非由于 update-locale 命令错了,而是由于 perl 的配置出了问题。测试
可使用如下命令只运行 perl 测试:code
$ perl -e exit
perl 使用系统提供的默认 locale zh_CN.UTF-8
,但这个值是 ssh 从客户端传递来的,系统其实不知道 zh_CN.UTF-8
该如何处理。get
咱们安装语言包便可解决问题:it
$ apt-get install language-pack-zh-hans $ dpkg-reconfigure locales