跳转到内容

将 WSL 中的 Ubuntu 的默认语言修改为中文 ​

1. 设置语言环境 ​

bash
sudo dpkg-reconfigure locales
bash
用户名@设备名:~$ sudo dpkg-reconfigure locales
[sudo] 用户名 的密码:
Generating locales (this might take a while)...
  zh_CN.UTF-8... done # 中文简体
  zh_SG.UTF-8... done # 中文 - 新加坡
Generation complete.

sudo dpkg-reconfigure locales - 1
(一直按 ↓ 键到最下面找到 zh 那些,按照你要简体还是繁体选,按空格确认,Enter 下一页)

sudo dpkg-reconfigure locales - 2
(和上一页的操作方法一致,找到你刚选的那个按下Enter选中)

2. 重启 WSL ​

bash
exit
powershell
wsl --shutdown
wsl -d Ubuntu

提示

如果还有问题试试这个:

bash
sudo apt update
sudo apt install language-pack-zh-hans