我在 AWS Lightsail 上全新安装的 Ubuntu 16.04 上遇到了这个问题
_____________________________________________________________________
WARNING! Your environment specifies an invalid locale.
The unknown environment variables are:
LC_CTYPE=UTF-8 LC_ALL=
This can affect your user experience significantly, including the
ability to manage packages. You may install the locales by running:
sudo apt-get install language-pack-UTF-8
or
sudo locale-gen UTF-8
To see all available language packs, run:
apt-cache search "^language-pack-[a-z][a-z]$"
To disable this message for all users, run:
sudo touch /var/lib/cloud/instance/locale-check.skip
_____________________________________________________________________
然后我按照说明
$ sudo apt-get install language-pack-UTF-8
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package language-pack-UTF-8
然后我尝试了另一个
$ sudo locale-gen UTF-8
Error: 'UTF-8' is not a supported language or locale
我现在应该怎么做?
答案1
这是一个猜测,因为我不知道 AWS Lightsail 如何工作。
显然,该LC_CTYPE
变量已被赋值("UTF-8"
),但在 Ubuntu 中这是无效的。因此,让我们清除该变量。
打开~/.profile
文件进行编辑,添加以下行:
unset LC_CTYPE
并重新登录。