Debain 报错 Can't set locale 问题处理

后知后觉 现有 1 评论

奇妙的问题,使用同一镜像启动的两台 AWS 虚拟机,在更新时其中一台提示报错,另一台完全正常。

问题

执行包更新命令时提示如下报错:

apt-listchanges: Can't set locale; make sure $LC_* and $LANG are correct!
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_TIME = "en_US.UTF-8",
    LC_MONETARY = "en_US.UTF-8",
    LC_ADDRESS = "en_US.UTF-8",
    LC_TELEPHONE = "en_US.UTF-8",
    LC_NAME = "en_US.UTF-8",
    LC_TERMINAL = "iTerm2",
    LC_MEASUREMENT = "en_US.UTF-8",
    LC_IDENTIFICATION = "en_US.UTF-8",
    LC_NUMERIC = "en_US.UTF-8",
    LC_PAPER = "en_US.UTF-8",
    LANG = "C.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("C.UTF-8").

处理

终端执行如下命令重新生成语言配置文件,根据实际选择即可,比如:选择 en_US.UTF-8 并回车确定更新;

sudo dpkg-reconfigure locales

然后退出终端,重新登录即可恢复正常。


附录

参考链接

如果遇到问题或者对文章内容存疑,请在下方留言,博主看到后将及时回复,谢谢!
回复 / 查看「历史评论
回答44+26=
  1. avatarImg rantrism

    您好~我是腾讯云开发者社区运营,关注了您分享的技术文章,觉得内容很棒,我们诚挚邀请您加入腾讯云自媒体分享计划。完整福利和申请地址请见:https://cloud.tencent.com/developer/support-plan
    作者申请此计划后将作者的文章进行搬迁同步到社区的专栏下,你只需要简单填写一下表单申请即可,我们会给作者提供包括流量、云服务器等,另外还有些周边礼物。

    Chrome 102.0 Windows 10 回复
    IP 属地 未知