区域设置:重置丢失的设置

区域设置:重置丢失的设置

由于某些奇怪的原因,我丢失了一些locale设置。我设法使用以下方法恢复了大部分设置sudo dpkg-reconfigure locales

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
 LANGUAGE = (unset),
 LC_ALL = (unset),
 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_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory

所以我坚持一个缺失的值:

$ locale
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
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

知道如何恢复它们吗?

谢谢,

亚当

答案1

我偶尔也会遇到这种情况。不知道是什么原因,但我就是会发:

sudo dpkg-reconfigure locales

这似乎解决了我的问题

答案2

如果您删除了某些文件,请尝试重新安装语言环境包:

apt-get install --reinstall locales

您可能希望对 language-support-(您的 langcode)、language-pack-(您的 langcode)-base 和其他适合您语言的语言包 (gnome、kde...) 执行相同的操作。

答案3

为了解决这个问题,我必须这么做:

sudo apt-get install --reinstall language-support-en

答案4

我时不时会遇到这个问题,但上述答案都帮不上忙。真正能帮到我的是将以下内容添加到 /etc/default/locales

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

相关内容