问题解决:apt-listchanges: Can’t set locale; make sure $LC_* and $LANG are correct!

最近新买了台云主机,选的是Debian 9系统,在更新软件的时候总是提示如下错误:

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 = "en_US.utf8",
    LC_ALL = (unset),
    LC_CTYPE = "zh_CN.UTF-8",
    LANG = "en_US.utf8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.utf8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

一次两次就算了,每次都遇到这问题,实在是不能忍,放狗搜了一把之后,想办法解决了。

其实问题很简单,我本地是zh_CN.UTF-8,但是服务器默认没有这个字符集,导致用iTerm2连上的时候,一直报错。

解决问题也很简单:

root@debian:~# dpkg-reconfigure locales

回车,上下选中所需要的空格选上,回车就行了。