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

Léo*_* 준영 6 debian locale raspberry-pi raspbian

我知道如何解决我的语言环境问题?,通过它我无法更改字段LANGUAGELC_ALL相应的值。我正在我的 Raspberry Pi 3B Raspbian 最新操作系统中设置retropie。我的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
Run Code Online (Sandbox Code Playgroud)

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

GAD*_*D3R 7

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

 en_GB.UTF-8 UTF-8
Run Code Online (Sandbox Code Playgroud)

跑:

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
Run Code Online (Sandbox Code Playgroud)

验证一下;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
Run Code Online (Sandbox Code Playgroud)

  • 如果你收到这样的错误 `perl: warning: Setting locale failed.` 并且如果以下几行提到“(unset)”变量,则需要在能够执行 `update-locale` 之前设置这些变量。所以总结一下,解决方案应该是: - 1. locale-gen, - 2. 导出变量 - 3. update-locale (2认同)