xiongyihui / notes

Notes
https://xiongyihui.github.io/notes/
3 stars 0 forks source link

Mosh locale issue #3

Open xiongyihui opened 7 years ago

xiongyihui commented 7 years ago

When running mosh, I got the following error:

The locale requested by LANG=en_US.UTF-8 isn't available here.
Running `locale-gen en_US.UTF-8' may be necessary.

The locale requested by LANG=en_US.UTF-8 isn't available here.
Running `locale-gen en_US.UTF-8' may be necessary.

mosh-server needs a UTF-8 native locale to run.

Unfortunately, the local environment (LANG=en_US.UTF-8) specifies
the character set "US-ASCII",

The client-supplied environment (LANG=en_US.UTF-8) specifies
the character set "US-ASCII".

locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:zh_CN
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
LC_ADDRESS=zh_CN.UTF-8
LC_TELEPHONE=zh_CN.UTF-8
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=zh_CN.UTF-8
LC_ALL=
Connection to XXX closed.
/usr/bin/mosh: Did not find mosh server startup message.

This is a issue that the environment variable LC_ALL is not set. We can run echo $LC_ALL or locale to check.

To temporarily solve the issue, first run export LC_ALL=en_US.UTF-8.

To solve it permanently, try sudo update-locale LC_ALL=en_US.UTF-8, it will add LC_ALL=en_US.UTF-8 to /etc/default/locale. When login next time, the environment variable LC_ALL will be set to en_US.UTF-8.

or use dpkg-reconfigure locales