我刚刚尝试将用户添加到组中
$ adduser someuser sudo
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = (unset),
LC_PAPER = "pl_PL.UTF-8",
LC_ADDRESS = "pl_PL.UTF-8",
LC_MONETARY = "pl_PL.UTF-8",
LC_NUMERIC = "pl_PL.UTF-8",
LC_TELEPHONE = "pl_PL.UTF-8",
LC_IDENTIFICATION = "pl_PL.UTF-8",
LC_MEASUREMENT = "pl_PL.UTF-8",
LC_TIME = "pl_PL.UTF-8",
LC_NAME = "pl_PL.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Adding user `someuser' to group `sudo' ...
Adding user someuser to group sudo
Done.
这是什么意思,出了什么问题以及如何消除错误?
答案1
您需要注意您的错误消息并针对缺少的区域设置发出命令。
例如,这是我收到的错误:
代码:
perl: warning: Setting locale failed. perl: warning:
Please check that your locale settings:
LANGUAGE = "en_CA:en",
LC_ALL = (unset),
LANG = "en_CA"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
LANG 字符串就是您需要的字符串。
从您的错误消息来看,这应该对您有用:
sudo locale-gen en_US en_US.UTF-8 pl_PL pl_PL.UTF-8
sudo dpkg-reconfigure locales
回想起来,在谷歌上搜索这个错误信息会发现很多修复方法;但很少有关于“为什么”或“如何”导致它的信息。我怀疑这与用户运行多个语言环境有关,这些语言环境的完整性可能存在差异。但我真的没有任何依据,除了:
- 我从来没有在我自己的机器上看到过它。
- 我的机器上的用户配置为仅使用一个语言环境。
更多参考: