I got this on a fresh installation of Ubuntu 16.04 on AWS Lightsail
_____________________________________________________________________
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
_____________________________________________________________________
Then I follow the instructions
$ 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
Then I tried the other one
$ sudo locale-gen UTF-8
Error: 'UTF-8' is not a supported language or locale
What should I do now?
This is a guess, since I don't know how AWS Lightsail works.
Apparently the
LC_CTYPE
variable has been assigned a value ("UTF-8"
) which is invalid in Ubuntu. So let's clear that variable.Open the
~/.profile
file for editing, add this line:and relogin.
Apparently the message left after I reboot.
In any case, I also explicitly set the
LC_CTYPE
in the default localesudo vim /etc/default/locale
I typed the following
sudo dpkg-reconfigure locales
which is a screen like this
For such screens, you have to use tab and space and your cursor keys to navigate
SElect the locale you want. In my case that will be
en_US.UTF-8
If you do this correctly, 2 screens later you should see
Then apparently you need to
sudo reboot