问题描述:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "zh_CN:zh",
LC_ALL = (unset),
LC_TIME = "zh_CN",
LC_MONETARY = "zh_CN",
LC_ADDRESS = "zh_CN",
LC_TELEPHONE = "zh_CN",
LC_NAME = "zh_CN",
LC_MEASUREMENT = "zh_CN",
LC_IDENTIFICATION = "zh_CN",
LC_NUMERIC = "zh_CN",
LC_PAPER = "zh_CN",
LANG = "zh_CN.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

解决方法:

1、配置想要的locale

cp /user/share/i18n/SUPPORTED /var/lib/locales/supported.d/local

打开/var/lib/locales/supported.d/local文件,将其中除了en_*和zh_*之外的值都删掉,然后

 locale-gen --purge

 

2、使用locale命令,将输出的值:

LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC=zh_CN
LC_TIME=zh_CN
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY=zh_CN
LC_MESSAGES="zh_CN.UTF-8"
LC_PAPER=zh_CN
LC_NAME=zh_CN
LC_ADDRESS=zh_CN
LC_TELEPHONE=zh_CN
LC_MEASUREMENT=zh_CN
LC_IDENTIFICATION=zh_CN
LC_ALL=

拷贝到/etc/environment文件中即可。

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-03-07
  • 2021-08-05
  • 2022-02-13
  • 2021-12-28
  • 2022-12-23
猜你喜欢
  • 2022-02-18
  • 2021-10-31
  • 2022-12-23
  • 2022-01-27
  • 2021-12-30
  • 2022-12-23
  • 2021-08-01
相关资源
相似解决方案