問題
我在 Raspberry pi 3 上的 Arch Linux 出現以下錯誤,讓 mosh 以及 tmux 還有 locale 都無法使用:
mosh:
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 27 28 29 30 31 32 |
➜ ~ mosh alarm@192.168.15.26 alarm@192.168.15.26‘s password: The locale requested by LC_CTYPE=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 ([no charset variables]) specifies the character set “US-ASCII”, The client–supplied environment (LC_CTYPE=en_US.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 LC_CTYPE=en_US.UTF–8 LC_NUMERIC=“en_US.UTF-8” LC_TIME=“en_US.UTF-8” LC_COLLATE=“en_US.UTF-8” LC_MONETARY=“en_US.UTF-8” LC_MESSAGES=“en_US.UTF-8” LC_PAPER=“en_US.UTF-8” LC_NAME=“en_US.UTF-8” LC_ADDRESS=“en_US.UTF-8” LC_TELEPHONE=“en_US.UTF-8” LC_MEASUREMENT=“en_US.UTF-8” LC_IDENTIFICATION=“en_US.UTF-8” LC_ALL= Connection to 192.168.15.26 closed. /usr/bin/mosh: Did not find mosh server startup message. |
tmux:
1 2 |
[alarm@kdr ~]$ tmux tmux: invalid LC_ALL, LC_CTYPE or LANG |
locale:
1 2 3 4 5 6 7 8 9 10 |
[alarm@kdr ~]$ sudo locale –a 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_COLLATE to default locale: No such file or directory C POSIX [alarm@kdr ~]$ locale–gen Generating locales... Generation complete. [alarm@kdr ~]$ |
解法
沒有把 /etc/locale.gen
內的 comment 拿掉,將需要的 language 解 comment,然後重新 generate 即可:
1 2 3 4 5 6 7 8 9 10 11 12 13 |
... #en_SG.UTF-8 UTF-8 #en_SG ISO-8859-1 en_US.UTF–8 UTF–8 #en_US ISO-8859-1 #en_ZA.UTF-8 UTF-8 ... [alarm@kdr~] sudo locale–gen Generating locales... en_US.UTF–8… done Generation complete. [alarm@kdr ~]$ |
Leave a Reply