为什么无法在语言环境中设置 LC_ALL 的值?

为什么无法在语言环境中设置 LC_ALL 的值?

我本地电脑上的操作系统。

uname -a
Linux debian 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3 (2019-09-02) x86_64 GNU/Linux

我当前的语言环境。

locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
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=

我想设置LC_ALL=C.UTF-8.

sudo localectl set-locale LC_ALL=C.UTF-8
Failed to issue method call: Invalid Locale data.

尝试设置一下 LC_ALL=en_US.UTF-8

sudo localectl set-locale  LC_ALL=en_US.UTF-8 
Failed to issue method call: Invalid Locale data.

默认值LC_ALL只能为空(空)?

答案1

正如 Arch Linux wiki 中所述区域设置,LC_ALL:故障排除

LC_ALL is the only LC_* variable which cannot be set in locale.conf files: it is meant to be used only for testing or troubleshooting purposes, for example in /etc/profile.

locale.conf — 区域设置的配置文件,在 systemd 文档中指出:

Note that LC_ALL may not be configured in this file.

相关内容