docker容器内设置ubuntu语言为中文
查看当前语言localeLANG=LANGUAGE=LC_CTYPE="POSIX"LC_NUMERIC="POSIX"LC_TIME="POSIX"LC_COLLATE="POSIX"LC_MONETARY="POSIX"LC_MESSAGES="POSIX"LC_PAPER="POSIX"LC_NAME="POSIX"LC_ADDRESS="POSIX"LC_TE...
·
- 查看当前语言
locale
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=
- 查看当前已安装的语言
locale -a
C
C.UTF-8
POSIX
- 安装语言包
apt-get install language-pack-zh-hans
locale-gen zh_CN.UTF-8
再次查看
locale -a
C
C.UTF-8
POSIX
zh_CN.utf8
zh_SG.utf8
- 添加到文件
echo "export LC_ALL=zh_CN.UTF-8">> /etc/profile
source /etc/profile
如果这里添加失败,提示没有这种语言包,退出容器,再重新进入,就可以添加了 - 完成
locale
LANG=
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=zh_CN.UTF-8
更多推荐
已为社区贡献1条内容
所有评论(0)