基于Debian/Ubuntu的Linux系统上安装中文语言包并生成对应的locale设置
2025-05-26
12
参考资料
更新软件包列表:
sudo apt update
安装简体中文语言包:
sudo apt install language-pack-zh-hans language-pack-zh-hans-base
安装中文字体(推荐):
sudo apt install fonts-wqy-microhei fonts-wqy-zenhei
生成中文locale:
sudo locale-gen zh_CN.UTF-8 sudo locale-gen zh_CN.GBK
设置系统locale:
sudo update-locale LANG=zh_CN.UTF-8
检查当前locale设置:
locale
可选安装中文输入法(如fcitx):
sudo apt install fcitx fcitx-pinyin fcitx-config-gtk
重启系统使更改生效:
sudo reboot
验证安装:
检查终端是否能显示中文
检查系统菜单是否已部分或全部显示为中文
尝试在文本编辑器中输入中文
注意:
如果只需要命令行中文支持,可以跳过图形界面相关的步骤
对于服务器环境,通常只需要前5步
要切换回英文界面,可将LANG设为en_US.UTF-8
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。