locale warning 怎么办

新配置的 vps 在 apt-get 时常常出现

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

网上搜索了一下解决方案,这里做个笔记


编辑 local 文件

vi /var/lib/locales/supported.d/local

输入以下内容

# This file names the currently supported and somewhat tested locales.
# If you have any additions please file a glibc bug report.
en_US.UTF-8 UTF-8
en_US ISO-8859-1
en_US.ISO-8859-15 ISO-8859-15
zh_CN.GB18030 GB18030
zh_CN.GBK GBK
zh_CN.UTF-8 UTF-8
zh_CN GB2312

重新生成一次 locale 即可

locale-gen --purge
您可能还喜欢

发表评论

电子邮件地址不会被公开。 必填项已用*标注

Time limit is exhausted. Please reload CAPTCHA.