From 31e0e7100f6c5bc50e4599fc26be9cd50a894b54 Mon Sep 17 00:00:00 2001 From: 8ga Date: Fri, 10 Jan 2025 11:10:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20ubuntu-lang.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ubuntu-lang.md | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 ubuntu-lang.md diff --git a/ubuntu-lang.md b/ubuntu-lang.md new file mode 100644 index 0000000..b1f0902 --- /dev/null +++ b/ubuntu-lang.md @@ -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 +``` \ No newline at end of file