今天在win10上安装了ubuntu子系统,以后再也不需要为了bash在mac和win10之间切换了。ubuntu子系统会自动将windows的盘挂载到/mnt/下面,但是进去以后发现中文目录无法显示。
按照网上的知道修改locale
jiangzd@jiangzd:/mnt/d$sudo vi /etc/default/locale
LANG=zh_CN.UTF-8
LANGUAGE=zh_CN:zh:en_US:en
LC_ALL=zh_CN.UTF-8
保存后再次执行locole,发现“LC_ALL to default locale: No such file or directory”和“LC_ALL: cannot change locale (zh_CN.UTF-8) ”错误。需要重新安装中文语言包
sudo apt-get -y install language-pack-zh-hans
如果需要繁体支持,还需执行
sudo apt-get -y install language-pack-zh-hant
安装后确认安装结果
jiangzd@jiangzd:/mnt/d$ locale -a
C
C.UTF-8
en_US.utf8
POSIX
zh_CN.utf8
zh_SG.utf8
再次输入locale,确认结果
jiangzd@jiangzd:/mnt/d$ locale
LANG=zh_CN.UTF-8
LANGUAGE=
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.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=
原文链接:https://www.f2er.com/ubuntu/350631.html