[英]File missing upon launching EC2 using Amazon Linux AMI
I've just launched an t2.micro
free tier EC2
instance and SSH into it from my local machine.我刚刚启动了一个
t2.micro
免费层EC2
实例,并从我的本地机器通过 SSH 连接到它。 And I was welcomed by an error message as below:我受到如下错误消息的欢迎:
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
This instance was launch using the console and every option has been by default and nothing special being configured.此实例是使用控制台启动的,默认情况下每个选项都已设置,没有任何特殊配置。 What could be the reason for it?
原因可能是什么?
Below is the Locale
of this instance:以下是此实例的
Locale
:
[root@ip-xxx .aws]# locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LC_CTYPE=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=
in my case it was required to add following lines to /etc/environment
在我的情况下,需要将以下几行添加到
/etc/environment
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
Also for later use add the same two commands to ~/.bash_profile
也为以后使用添加相同的两个命令
~/.bash_profile
Based on @ardit comment基于@ardit 评论
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.