在 sudo apt-get upgrade 時,會出現下列錯誤訊息:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
解決方式如下:
- 若你的 ~/.bashrc 或 ~/.bashprofile 裡有
LANGUAGE=en_US:en
LANG=en_US.UTF-8
請 comment 掉或刪掉 - 在~/.bashrc 裡加上
export LC_ALL="en_US.UTF-8" - 執行
sudo locale-gen zh_TW.UTF-8
sudo dpkg-reconfigure locales