AWS Ubuntu 账号登录提示 LC_CTYPE 不存在

登录 aws 主机的时候, 偶尔会出现下面的提示:

1
manpath: can't set the locale; make sure $LC_* and $LANG are correct

解决方案如下, 在初始化账户的时候, 首次登录已经做出以下提示:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

_____________________________________________________________________
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
_____________________________________________________________________

即安装相应的包支持:

1
2
3
sudo apt-get install language-pack-UTF-8
# 或者
sudo locale-gen UTF-8
Donate - Support to make this site better.
捐助 - 支持我让我做得更好.