Linux命令修改语言为中文
2019-05-03 02:41:37

1. 查看系统当前语言包

[root@VM_18_167_centos ~]# locale

CentOS7.5修改系统语言为简体中文

2. 查看系统拥有的语言包

[root@VM_18_167_centos ~]# locale -a

CentOS7.5修改系统语言为简体中文

如果没有zh_CN.utf8,则需要单独安装中文语言包

[root@VM_18_167_centos ~]# yum install kde-l10n-Chinese

3. 设置为中文(临时修改,服务器重启之后会还原之前的设置)

// 设置为中文 [root@VM_18_167_centos ~]# LANG="zh_CN.UTF-8" // 设置为英文 [root@VM_18_167_centos ~]# LANG="en_US.UTF-8"

4. 设置为中文(永久有效)

3.1 方式一
[root@VM_18_167_centos ~]# localectl  set-locale.UTF8
3.2 方式二
[root@VM_18_167_centos ~]# vi /etc/locale.conf

添加以下内容到第一行,设置为中文

LANG=zh_CN.UTF8