知识库

记录共享技术内容

locale: Cannot set LC_ALL to default locale: No such file or directory

在Ubuntu安装软件时,系统提示报错信息如下:
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”).
locale: Cannot set LC_ALL to default locale: No such file or directory

最佳方法是
修改/var/lib/locales/supported.d/local,追加一行如下内容:

zh_CN.UTF-8 UTF-8

然后:

sudo locale-gen
sudo dpkg-reconfigure locales

就完美解决了。

点赞

Leave a Reply

Your email address will not be published. Required fields are marked *