locale 遺失解決方法

遇到以下狀況情形時:

LANGUAGE = "zh_TW:en",
LC_ALL = (unset),
LC_MESSAGES = "zh_TW.UTF-8",
LANG = "zh_TW"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory

首先:

dpkg-reconfigure locales
locale-gen
locale

會顯示:

LANG=en_US.UTF-8
LANGUAGE=
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=

比對差異處或空白欄位重新補上:

export LC_ALL="en_US.utf8"

新增到 /etc/default/locale

nano  /etc/default/locale
LANGUAGE="en_US.UTF-8"
LC_ALL="en_US.UTF-8"

補上之後

locale-gen

即可解決

阅读剩余
THE END