docker无法显示中文

本人用docker创建了一个ubuntu:22.04的容器,但是居然无法显示中文,网上的教程都是让你export LANG=zh_CN.UTF-8,但是这没什么卵用

结合https://www.cnblogs.com/BillyLV/p/12658463.html
应当先安装中文语言包

apt update
apt install -y language-pack-zh-hans

如果你安装时发现出现以下类似报错,就需要先apt update

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/l/language-pack-zh-hans-base/language-pack-zh-hans-base_22.04%2b20240212_all.deb  404  Not Found [IP: 91.189.91.83 80]

然后

export LANG=zh_CN.UTF-8
posted @ 2024-11-17 15:35  王冰冰  阅读(139)  评论(1)    收藏  举报