Welcome

首页 / 操作系统 / Linux / Debian终端无法正常显示中文的解决方法

在安装完Debian时,尤其是精简安装,没有安装桌面环境时,使用终端过程中,经常出现中文显示为乱码的情况。 主要解决办法:
sudo apt install locales
安装之后运行配置:
dpkg-reconfigure locales

选择合适的中文语言包,如:zh_CN.UTF-8.

建议在选择时将以下几种全部加入

zh_CN.UTF-8
zh_HK.UTF-8
zh_SG.UTF-8
zh_TW.UFT-8


确定重启即可。

过程中如果遇到please specify a package to reconfigure错误,则可以使用如下指令运行:

sudo sh -c 'dpkg-reconfigure locales'
即可。