Foreword: Linux [cloud server] (https://cloud.tencent.com/product/cvm?from=10680) switched from CentOS 6.5 to CentOS 7.6
Many things on CentOS 7 are different from 6. Before changing the Chinese environment, this file was generally used: /etc/sysconfig/i18n. The file in CentOS 7 still exists, but the content in the file is empty.
Manually write the following content, the system language is still English:
# LANG="en_US.UTF-8"
LANG="zh_CN.UTF-8"
SYSFONT="latarcyrheb-sun16"
locale -a #View language packs owned by the system
echo $LANG #Check current locale
locale #List more detailed language information
zh_CN.UTF-8 is simplified Chinese, this is the same as above 6. If there is no zh_CN.UTF-8, you need to install the Chinese package
yum install kde-l10n-Chinese #installation
locale -a|grep zh_CN #Check to confirm
LANG="zh_CN.UTF-8" #Modified to Chinese
LANG="en_US.UTF-8" #Modified to English
vi /etc/locale.conf
# LANG=en_US.UTF-8 #You can directly remove the comment when switching later
LANG=zh_CN.UTF-8
shutdown -r now
https://blog.csdn.net/xiaoxiaoyu_2008/article/details/81044579
Recommended Posts