1、更换 CentOS yum 源为国内镜像
备份原 repo 文件:
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
下载阿里云的 CentOS 7 repo 文件:
wget https://mirrors.aliyun.com/repo/Centos-7.repo
mv Centos-7.repo CentOS-Base.repo
清理缓存并重建:
yum clean all
yum makecache
2、安装 fontconfig
yum install fontconfig -y
安装完毕后查看是否安装中文字体
fc-list :lang=zh
3、安装文泉驿正黑字体(wqy-zenhei,开源)
开始安装
yum install wqy-zenhei-fonts -y
然后更新字体缓存:
fc-cache -fv
验证是否安装成功:
fc-list :lang=zh
安装结果参考:
[root@e3erp01 yum.repos.d]# fc-list :lang=zh
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei:style=Regular
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Sharp,文泉驛點陣正黑:style=Regular
/usr/share/fonts/wqy-zenhei/wqy-zenhei.ttc: WenQuanYi Zen Hei Mono:style=Regular