如何在 Raspbian 中设置 LC_ALL=en_GB.UTF-8?

如何在 Raspbian 中设置 LC_ALL=en_GB.UTF-8?

我知道帖子里的答案如何解决我的区域设置问题?,我无法将字段LANGUAGE和更改LC_ALL为相应的值。我正在设置回顾在我的 Raspberry Pi 3B Raspbian 中是最新的操作系统。我的locale

LANG=en_GB.UTF-8
LANGUAGE= # TODO empty! but should be en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB:UTF-8"
LC_PAPER="en_GB.UTF-8"
LC_NAME="en_GB.UTF-8"
LC_ADDRESS="en_GB.UTF-8"
LC_TELEPHONE="en_GB.UTF-8"
LC_MEASUREMENT="en_GB.UTF-8"
LC_IDENTIFICATION="en_GB.UTF-8"
LC_ALL= # TODO empty but should be en_GB.UTF-8

操作系统:Raspbian
硬件:Raspberry Pi 3B

答案1

编辑/etc/locale.gen然后取消注释以下行:

 en_GB.UTF-8 UTF-8

跑步:

locale-gen en_GB.UTF-8 UTF-8
update-locale en_GB.UTF-8 UTF-8
export LANGUAGE=en_GB.UTF-8
export LC_ALL=en_GB.UTF-8

验证一下;locale:

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

答案2

StephenKitt的建议:不要设置LC_ALLand,LANGUAGE因为你在这里不需要它们。经过测试,这个方法也有效。

相关内容