在 Debian 系统中替换(更改)系统语言,通常可以通过 终端命令 完成,主要有两种常用方式:dpkg-reconfigure 和 update-locale。下面按使用场景详细说明。
使用 dpkg-reconfigure 会弹出图形化/文本界面,选择语言。
sudo apt update
sudo apt install locales
sudo dpkg-reconfigure locales
zh_CN.UTF-8 UTF-8)reboot
或注销重新登录。
locale
locale -a
sudo update-locale LANG=zh_CN.UTF-8
或英文:
sudo update-locale LANG=en_US.UTF-8
source /etc/default/locale
或重启系统。
编辑 ~/.bashrc 或 ~/.profile:
export LANG=zh_CN.UTF-8
export LANGUAGE=zh_CN:zh
export LC_ALL=zh_CN.UTF-8
然后:
source ~/.bashrc
安装中文字体:
sudo apt install fonts-noto-cjk
有些程序只认 LANGUAGE:
export LANGUAGE=zh_CN:zh
✅ 建议服务器使用:
LANG=en_US.UTF-8
| 场景 | 推荐语言 |
|---|---|
| 桌面系统 | zh_CN.UTF-8 |
| 服务器 | en_US.UTF-8 |
| 多语言 | 保留多个 locale |
如果你愿意告诉我:
我可以给你一条 最合适、最简命令 ✅