3

Always, when I install mosh on a raspberry pi and try to connect through my computer, I get the following error:

lz@blade:~$ mosh -ssh="ssh -p 2323" pi@192.168.0.3
pi@192.168.0.3's password: 
The locale requested by LC_CTYPE=pt_BR.UTF-8 isn't available here.
Running `locale-gen pt_BR.UTF-8' may be necessary.

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

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

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

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

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES 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
LANGUAGE=
LC_CTYPE=pt_BR.UTF-8
LC_NUMERIC=pt_BR.UTF-8
LC_TIME=pt_BR.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=pt_BR.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=pt_BR.UTF-8
LC_NAME=pt_BR.UTF-8
LC_ADDRESS=pt_BR.UTF-8
LC_TELEPHONE=pt_BR.UTF-8
LC_MEASUREMENT=pt_BR.UTF-8
LC_IDENTIFICATION=pt_BR.UTF-8
LC_ALL=
Connection to 192.168.0.3 closed.
/usr/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

I already tried

and many other solutions.

I'm using Ubuntu 18.04 on the client and Raspbian on the server.

Pablo Bianchi
  • 15,657
Guerlando OCs
  • 863
  • 10
  • 51
  • 88
  • Try to run localedef -i pt_BR -c -f UTF-8 -A /usr/share/locale/locale.alias pt_BR.UTF-8 on your server ( 192.168.0.3 ) as root or prepend that with sudo. – Thomas Oct 06 '18 at 13:49
  • I do not know raspbian, but if the file /etc/locale.gen is available, open that with a text editor as root and uncomment the pt_BR.UTF-8 line. After that run locale-gen, which should run the command above and should be the preferred way. – Thomas Oct 06 '18 at 14:03

3 Answers3

5

I fixed this issue with this trick of issue #916, logging into server and running:

sudo dpkg-reconfigure locales

Using same locales than on local machine. #793/this should also work.

BTW then you can make some clean up.

Pablo Bianchi
  • 15,657
1

Please try to comment out the below line in /etc/ssh/sshd_config in your server

####AcceptEnv LANG LC_*

And then run "/etc/init.d/ssh restart"

Reason I guessed:

I think your terminal is sending LANG and LC_* locale to your server, your sever will requrire the existence of the same locale, after that, your server can use the locale setting you have set as you all have just said.

Bill Zhao
  • 121
0

Running this command on the terminal (server-side) helped me fix the issue:

locale-gen en_US.UTF-8