AWS Linux 2 --bash:警告:setlocale:LC_CTYPE:无法更改语言环境(en_US.UTF-8):错误

AWS Linux 2 --bash:警告:setlocale:LC_CTYPE:无法更改语言环境(en_US.UTF-8):错误

我的 AWS AMI Linux 2 上出现了以下错误,我不知道为什么。我也无法运行 sudo yum update。错误如下。

https://aws.amazon.com/amazon-linux-2/
-bash: warning: setlocale: LC_CTYPE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_COLLATE: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_MESSAGES: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_NUMERIC: cannot change locale (en_US.UTF-8): No such file or directory
-bash: warning: setlocale: LC_TIME: cannot change locale (en_US.UTF-8): No such file or directory

凯文

答案1

我正在使用 AWS Linux,这解决了我的问题:

sudo localedef -i en_US -f UTF-8 en_US.UTF-8

相关内容