Linux VPS Centos 8 安 装中文(zh_CN)语言包

首先查看当前字符集

[root@vmi481870 ~]# locale -a |grep CN
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_COLLATE to default locale: No such file or directory

看看有没有zh_CN.utf8

locale -a |grep CN

没有就安装

yum install -y langpacks-zh_CN

安装后再次确认配置

vi /etc/locale.conf

LANG=”zh_CN.UTF-8″

修改后重启即可


[root@vmi481870 ~]# yum install -y langpacks-zh_CN
Failed to set locale, defaulting to C.UTF-8
google-chrome                                                                                55 kB/s | 3.5 kB     00:00    
Dependencies resolved.
============================================================================================================================
 Package                            Architecture            Version                        Repository                  Size
============================================================================================================================
Installing:
 langpacks-zh_CN                    noarch                  1.0-12.el8                     AppStream                  9.6 k
Installing weak dependencies:
 glibc-langpack-zh                  x86_64                  2.28-101.el8                   BaseOS                     2.1 M

Transaction Summary
============================================================================================================================
Install  2 Packages

Total download size: 2.2 M
Installed size: 15 M
Downloading Packages:
(1/2): langpacks-zh_CN-1.0-12.el8.noarch.rpm                                                2.5 MB/s | 9.6 kB     00:00    
(2/2): glibc-langpack-zh-2.28-101.el8.x86_64.rpm                                            9.7 MB/s | 2.1 MB     00:00    
----------------------------------------------------------------------------------------------------------------------------
Total                                                                                       9.6 MB/s | 2.2 MB     00:00     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                    1/1 
  Installing       : glibc-langpack-zh-2.28-101.el8.x86_64                                                              1/2 
  Installing       : langpacks-zh_CN-1.0-12.el8.noarch                                                                  2/2 
  Running scriptlet: langpacks-zh_CN-1.0-12.el8.noarch                                                                  2/2 
  Verifying        : glibc-langpack-zh-2.28-101.el8.x86_64                                                              1/2 
  Verifying        : langpacks-zh_CN-1.0-12.el8.noarch                                                                  2/2 
Installed products updated.

Installed:
  glibc-langpack-zh-2.28-101.el8.x86_64                          langpacks-zh_CN-1.0-12.el8.noarch                         

Complete!
[root@vmi481870 ~]# vi /etc/locale.conf

图片[1]-Linux VPS  Centos  8 安 装中文(zh_CN)语言包-栗子博客

© 版权声明
THE END
点赞0
抢沙发
头像
提交
头像

昵称

取消
昵称
一言一语