1
0

添加 ubuntu-lang.md

This commit is contained in:
8ga 2025-01-10 11:10:04 +08:00
parent 0c9f557d31
commit 31e0e7100f

62
ubuntu-lang.md Normal file
View File

@ -0,0 +1,62 @@
升级更新现有的包(可选)
```
apt update && sudo apt upgrade -y
```
安装语言包和字体
```
apt install language-pack-zh-hans fonts-noto-cjk
```
生成本地化文件
```
locale-gen zh_CN.UTF-8
```
设为默认语言
```
echo "LANG=zh_CN.UTF-8" | sudo tee /etc/locale.conf
```
设置所有变量(可选)
```
vim /etc/environment
```
编辑以下内容
```
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
LC_ALL="zh_CN.UTF-8"
```
刷新
```
source /etc/environment
```
验证
```
locale
```
重启系统对所有应用生效
```
reboot
```
配置SSH登录提示为中文(可选)
```
vim /etc/ssh/sshd_config
```
编辑
```
AcceptEnv LANG LC_*
```
重启SSH服务
```
sudo systemctl restart ssh
```