Bootstrap

在Ubuntu系统中安装字体(以安装华文行楷和方正舒体为例)

背景:笔者在做一个项目时,因为项目是在windows系统中开发的,用react写的页面,在windows本地验证是没有问题,但是部署到服务器(服务器系统为Ubuntu)字体立马就变了,经过排错原来发现是ubuntu系统中没有我设计的那两种字体,即华文行楷方正舒体,所以解决问题的思路自然而然就是给服务器安装那两种字体,故写此博客,供大家学习交流。

以在ubuntu20.04系统中安装华文行楷方正舒体两个字体为例

在这里插入图片描述

0. 检查ubuntu中是否存在自己所需要的字体

命令:fc-list :lang=zh

# 使用下面命令查看是否有没有安装自己所需的字体
lab@lab-7920-Tower:~$ fc-list :lang=zh
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW MBE:style=Light
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK SC:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK TC:style=Bold
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai CN:style=Book
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK HK,Noto Sans CJK HK Black:style=Black,Regular
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai HK:style=Book
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK JP:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK KR:style=Bold
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW:style=Book
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK JP:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK HK:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK KR:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK TC,Noto Sans CJK TC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK KR,Noto Serif CJK KR Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK KR,Noto Sans CJK KR Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK SC:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK SC,Noto Serif CJK SC SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK TC:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK JP,Noto Sans CJK JP Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK JP,Noto Serif CJK JP Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK KR,Noto Sans CJK KR Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK HK,Noto Sans CJK HK Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK SC,Noto Sans CJK SC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK SC:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK TC:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK SC,Noto Sans CJK SC Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK JP,Noto Serif CJK JP Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK JP:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK KR:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK SC,Noto Serif CJK SC ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK KR,Noto Sans CJK KR Medium:style=Medium,Regular
/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf: Droid Sans Fallback:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK JP,Noto Sans CJK JP DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK JP,Noto Sans CJK JP Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK JP,Noto Sans CJK JP Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK SC,Noto Serif CJK SC Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK TC,Noto Serif CJK TC ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK KR,Noto Sans CJK KR Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK KR,Noto Serif CJK KR ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK HK,Noto Sans CJK HK Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK SC,Noto Sans CJK SC Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK JP,Noto Serif CJK JP SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK SC,Noto Serif CJK SC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK TC,Noto Sans CJK TC DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK SC,Noto Serif CJK SC Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK SC,Noto Sans CJK SC DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK TC,Noto Sans CJK TC Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK JP,Noto Sans CJK JP Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK KR,Noto Serif CJK KR Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK KR,Noto Serif CJK KR SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK SC,Noto Sans CJK SC Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK TC,Noto Serif CJK TC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK TC:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK KR,Noto Sans CJK KR DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK SC:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK KR:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK HK:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK JP:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK TC,Noto Serif CJK TC Medium:style=Medium,Regular
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW MBE:style=Book
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK JP,Noto Serif CJK JP ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW:style=Light
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK KR,Noto Serif CJK KR Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK HK,Noto Sans CJK HK Medium:style=Medium,Regular
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing CN:style=Light
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing HK:style=Light
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK TC,Noto Serif CJK TC SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK SC:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK TC:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK TC,Noto Serif CJK TC Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK HK:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK KR:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK JP:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK TC,Noto Sans CJK TC Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK HK,Noto Sans CJK HK DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK JP:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK KR:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK HK:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK TC:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK SC:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK JP,Noto Serif CJK JP Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK TC,Noto Sans CJK TC Light:style=Light,Regular

1. 下载或者在windows中拷贝字体

文件夹路径:C:\Windows\Fonts
在这里插入图片描述
拷贝自己所需要的文件到本地桌面,记得查看文件后缀是不是.ttf,如果不是,请改成.ttf格式,不然ubuntu系统不会识别,其他系统也一样。将文件夹压缩成压缩包,上传至ubuntu服务器
在这里插入图片描述

2. 在ubuntu中解压,执行以下命令

我文件夹解压在桌面:
在这里插入图片描述

# 大家按照自己的文件夹解压路径,修改`/home/lab/font`即可
lab@lab-7920-Tower:~$ sudo cp -r /home/lab/font /usr/share/fonts

3. 在命令行中执行以下三条命令

lab@lab-7920-Tower:~/font$ sudo mkfontscale
lab@lab-7920-Tower:~/font$ sudo mkfontdir
lab@lab-7920-Tower:~/font$ sudo fc-cache -fv

lab@lab-7920-Tower:~/font$ sudo mkfontscale
lab@lab-7920-Tower:~/font$ sudo mkfontdir
lab@lab-7920-Tower:~/font$ sudo fc-cache -fv
/usr/share/fonts: 正在生成缓存,新增缓存内容:0 个字体,7 个目录
/usr/share/fonts/X11: 正在生成缓存,新增缓存内容:0 个字体,4 个目录
/usr/share/fonts/X11/Type1: 正在生成缓存,新增缓存内容:8 个字体,0 个目录
/usr/share/fonts/X11/encodings: 正在生成缓存,新增缓存内容:0 个字体,1 个目录
/usr/share/fonts/X11/encodings/large: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/X11/misc: 正在生成缓存,新增缓存内容:89 个字体,0 个目录
/usr/share/fonts/X11/util: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/cMap: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/cmap: 正在生成缓存,新增缓存内容:0 个字体,5 个目录
/usr/share/fonts/cmap/adobe-cns1: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/cmap/adobe-gb1: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/cmap/adobe-japan1: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/cmap/adobe-japan2: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/cmap/adobe-korea1: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/usr/share/fonts/font: 正在生成缓存,新增缓存内容:2 个字体,0 个目录
/usr/share/fonts/opentype: 正在生成缓存,新增缓存内容:0 个字体,3 个目录
/usr/share/fonts/opentype/malayalam: 正在生成缓存,新增缓存内容:7 个字体,0 个目录
/usr/share/fonts/opentype/noto: 正在生成缓存,新增缓存内容:73 个字体,0 个目录
/usr/share/fonts/opentype/urw-base35: 正在生成缓存,新增缓存内容:35 个字体,0 个目录
/usr/share/fonts/truetype: 正在生成缓存,新增缓存内容:0 个字体,47 个目录
/usr/share/fonts/truetype/Gargi: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/Gubbi: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/Nakula: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/Navilu: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/Sahadeva: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/Sarai: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/abyssinica: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/arphic: 正在生成缓存,新增缓存内容:8 个字体,0 个目录
/usr/share/fonts/truetype/dejavu: 正在生成缓存,新增缓存内容:6 个字体,0 个目录
/usr/share/fonts/truetype/droid: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/fonts-beng-extra: 正在生成缓存,新增缓存内容:6 个字体,0 个目录
/usr/share/fonts/truetype/fonts-deva-extra: 正在生成缓存,新增缓存内容:3 个字体,0 个目录
/usr/share/fonts/truetype/fonts-gujr-extra: 正在生成缓存,新增缓存内容:5 个字体,0 个目录
/usr/share/fonts/truetype/fonts-guru-extra: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/fonts-kalapi: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/fonts-orya-extra: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/fonts-telu-extra: 正在生成缓存,新增缓存内容:2 个字体,0 个目录
/usr/share/fonts/truetype/fonts-yrsa-rasa: 正在生成缓存,新增缓存内容:10 个字体,0 个目录
/usr/share/fonts/truetype/freefont: 正在生成缓存,新增缓存内容:12 个字体,0 个目录
/usr/share/fonts/truetype/kacst: 正在生成缓存,新增缓存内容:15 个字体,0 个目录
/usr/share/fonts/truetype/kacst-one: 正在生成缓存,新增缓存内容:2 个字体,0 个目录
/usr/share/fonts/truetype/lao: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/liberation: 正在生成缓存,新增缓存内容:16 个字体,0 个目录
/usr/share/fonts/truetype/liberation2: 正在生成缓存,新增缓存内容:12 个字体,0 个目录
/usr/share/fonts/truetype/lohit-assamese: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-bengali: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-devanagari: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-gujarati: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-kannada: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-malayalam: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-oriya: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-punjabi: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-tamil: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-tamil-classical: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/lohit-telugu: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/malayalam: 正在生成缓存,新增缓存内容:10 个字体,0 个目录
/usr/share/fonts/truetype/noto: 正在生成缓存,新增缓存内容:2 个字体,0 个目录
/usr/share/fonts/truetype/openoffice: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/padauk: 正在生成缓存,新增缓存内容:4 个字体,0 个目录
/usr/share/fonts/truetype/pagul: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/samyak: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/samyak-fonts: 正在生成缓存,新增缓存内容:3 个字体,0 个目录
/usr/share/fonts/truetype/sinhala: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/tibetan-machine: 正在生成缓存,新增缓存内容:1 个字体,0 个目录
/usr/share/fonts/truetype/tlwg: 正在生成缓存,新增缓存内容:58 个字体,0 个目录
/usr/share/fonts/truetype/ttf-khmeros-core: 正在生成缓存,新增缓存内容:2 个字体,0 个目录
/usr/share/fonts/truetype/ubuntu: 正在生成缓存,新增缓存内容:14 个字体,0 个目录
/usr/share/fonts/type1: 正在生成缓存,新增缓存内容:0 个字体,1 个目录
/usr/share/fonts/type1/urw-base35: 正在生成缓存,新增缓存内容:35 个字体,0 个目录
/usr/local/share/fonts: 正在生成缓存,新增缓存内容:0 个字体,0 个目录
/root/.local/share/fonts: 跳过,无此目录
/root/.fonts: 跳过,无此目录
/usr/share/fonts/X11: 跳过,探测到循环目录
/usr/share/fonts/cMap: 跳过,探测到循环目录
/usr/share/fonts/cmap: 跳过,探测到循环目录
/usr/share/fonts/font: 跳过,探测到循环目录
/usr/share/fonts/opentype: 跳过,探测到循环目录
/usr/share/fonts/truetype: 跳过,探测到循环目录
/usr/share/fonts/type1: 跳过,探测到循环目录
/usr/share/fonts/X11/Type1: 跳过,探测到循环目录
/usr/share/fonts/X11/encodings: 跳过,探测到循环目录
/usr/share/fonts/X11/misc: 跳过,探测到循环目录
/usr/share/fonts/X11/util: 跳过,探测到循环目录
/usr/share/fonts/cmap/adobe-cns1: 跳过,探测到循环目录
/usr/share/fonts/cmap/adobe-gb1: 跳过,探测到循环目录
/usr/share/fonts/cmap/adobe-japan1: 跳过,探测到循环目录
/usr/share/fonts/cmap/adobe-japan2: 跳过,探测到循环目录
/usr/share/fonts/cmap/adobe-korea1: 跳过,探测到循环目录
/usr/share/fonts/opentype/malayalam: 跳过,探测到循环目录
/usr/share/fonts/opentype/noto: 跳过,探测到循环目录
/usr/share/fonts/opentype/urw-base35: 跳过,探测到循环目录
/usr/share/fonts/truetype/Gargi: 跳过,探测到循环目录
/usr/share/fonts/truetype/Gubbi: 跳过,探测到循环目录
/usr/share/fonts/truetype/Nakula: 跳过,探测到循环目录
/usr/share/fonts/truetype/Navilu: 跳过,探测到循环目录
/usr/share/fonts/truetype/Sahadeva: 跳过,探测到循环目录
/usr/share/fonts/truetype/Sarai: 跳过,探测到循环目录
/usr/share/fonts/truetype/abyssinica: 跳过,探测到循环目录
/usr/share/fonts/truetype/arphic: 跳过,探测到循环目录
/usr/share/fonts/truetype/dejavu: 跳过,探测到循环目录
/usr/share/fonts/truetype/droid: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-beng-extra: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-deva-extra: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-gujr-extra: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-guru-extra: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-kalapi: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-orya-extra: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-telu-extra: 跳过,探测到循环目录
/usr/share/fonts/truetype/fonts-yrsa-rasa: 跳过,探测到循环目录
/usr/share/fonts/truetype/freefont: 跳过,探测到循环目录
/usr/share/fonts/truetype/kacst: 跳过,探测到循环目录
/usr/share/fonts/truetype/kacst-one: 跳过,探测到循环目录
/usr/share/fonts/truetype/lao: 跳过,探测到循环目录
/usr/share/fonts/truetype/liberation: 跳过,探测到循环目录
/usr/share/fonts/truetype/liberation2: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-assamese: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-bengali: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-devanagari: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-gujarati: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-kannada: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-malayalam: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-oriya: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-punjabi: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-tamil: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-tamil-classical: 跳过,探测到循环目录
/usr/share/fonts/truetype/lohit-telugu: 跳过,探测到循环目录
/usr/share/fonts/truetype/malayalam: 跳过,探测到循环目录
/usr/share/fonts/truetype/noto: 跳过,探测到循环目录
/usr/share/fonts/truetype/openoffice: 跳过,探测到循环目录
/usr/share/fonts/truetype/padauk: 跳过,探测到循环目录
/usr/share/fonts/truetype/pagul: 跳过,探测到循环目录
/usr/share/fonts/truetype/samyak: 跳过,探测到循环目录
/usr/share/fonts/truetype/samyak-fonts: 跳过,探测到循环目录
/usr/share/fonts/truetype/sinhala: 跳过,探测到循环目录
/usr/share/fonts/truetype/tibetan-machine: 跳过,探测到循环目录
/usr/share/fonts/truetype/tlwg: 跳过,探测到循环目录
/usr/share/fonts/truetype/ttf-khmeros-core: 跳过,探测到循环目录
/usr/share/fonts/truetype/ubuntu: 跳过,探测到循环目录
/usr/share/fonts/type1/urw-base35: 跳过,探测到循环目录
/usr/share/fonts/X11/encodings/large: 跳过,探测到循环目录
/var/cache/fontconfig: cleaning cache directory
/var/cache/fontconfig: invalid cache file: 3830d5c3ddfd5cd38a049b759396e72e-le64.cache-7
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: 缓存生成成功
lab@lab-7920-Tower:~/font$ 

4. 验证字体是否安装成功

执行刚开始步骤,看看是否存在我们安装的华文行楷方正舒体两个字体即可。
命令:fc-list :lang=zh
在这里插入图片描述

lab@lab-7920-Tower:~/font$ fc-list :lang=zh
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW MBE:style=Light
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK SC:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK TC:style=Bold
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai CN:style=Book
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK HK,Noto Sans CJK HK Black:style=Black,Regular
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai HK:style=Book
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK JP:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Bold.ttc: Noto Serif CJK KR:style=Bold
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW:style=Book
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK JP:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK HK:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK KR:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK TC,Noto Sans CJK TC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK KR,Noto Serif CJK KR Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK KR,Noto Sans CJK KR Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK SC:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK SC,Noto Serif CJK SC SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans CJK TC:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK JP,Noto Sans CJK JP Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK JP,Noto Serif CJK JP Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK KR,Noto Sans CJK KR Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK HK,Noto Sans CJK HK Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK SC,Noto Sans CJK SC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK SC:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK TC:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK SC,Noto Sans CJK SC Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK JP,Noto Serif CJK JP Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK JP:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Regular.ttc: Noto Serif CJK KR:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK SC,Noto Serif CJK SC ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK KR,Noto Sans CJK KR Medium:style=Medium,Regular
/usr/share/fonts/truetype/droid/DroidSansFallbackFull.ttf: Droid Sans Fallback:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK JP,Noto Sans CJK JP DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK JP,Noto Sans CJK JP Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK JP,Noto Sans CJK JP Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK SC,Noto Serif CJK SC Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK TC,Noto Serif CJK TC ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK KR,Noto Sans CJK KR Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK KR,Noto Serif CJK KR ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK HK,Noto Sans CJK HK Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK SC,Noto Sans CJK SC Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK JP,Noto Serif CJK JP SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK SC,Noto Serif CJK SC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK TC,Noto Sans CJK TC DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK SC,Noto Serif CJK SC Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK SC,Noto Sans CJK SC DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK TC,Noto Sans CJK TC Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Black.ttc: Noto Sans CJK JP,Noto Sans CJK JP Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK KR,Noto Serif CJK KR Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK KR,Noto Serif CJK KR SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK SC,Noto Sans CJK SC Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK TC,Noto Serif CJK TC Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK TC:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK KR,Noto Sans CJK KR DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK SC:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK KR:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK HK:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans Mono CJK JP:style=Bold
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK TC,Noto Serif CJK TC Medium:style=Medium,Regular
/usr/share/fonts/truetype/arphic/ukai.ttc: AR PL UKai TW MBE:style=Book
/usr/share/fonts/opentype/noto/NotoSerifCJK-ExtraLight.ttc: Noto Serif CJK JP,Noto Serif CJK JP ExtraLight:style=ExtraLight,Regular
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing TW:style=Light
/usr/share/fonts/opentype/noto/NotoSerifCJK-Black.ttc: Noto Serif CJK KR,Noto Serif CJK KR Black:style=Black,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Medium.ttc: Noto Sans CJK HK,Noto Sans CJK HK Medium:style=Medium,Regular
/usr/share/fonts/font/STXINGKA.TTF: 华文行楷,STXingkai:style=Regular
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing CN:style=Light
/usr/share/fonts/truetype/arphic/uming.ttc: AR PL UMing HK:style=Light
/usr/share/fonts/opentype/noto/NotoSerifCJK-SemiBold.ttc: Noto Serif CJK TC,Noto Serif CJK TC SemiBold:style=SemiBold,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK SC:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK TC:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Light.ttc: Noto Serif CJK TC,Noto Serif CJK TC Light:style=Light,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK HK:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK KR:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Regular.ttc: Noto Sans Mono CJK JP:style=Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Thin.ttc: Noto Sans CJK TC,Noto Sans CJK TC Thin:style=Thin,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-DemiLight.ttc: Noto Sans CJK HK,Noto Sans CJK HK DemiLight:style=DemiLight,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK JP:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK KR:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK HK:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK TC:style=Bold
/usr/share/fonts/opentype/noto/NotoSansCJK-Bold.ttc: Noto Sans CJK SC:style=Bold
/usr/share/fonts/font/FZSTK.TTF: 方正舒体,FZShuTi:style=Regular
/usr/share/fonts/opentype/noto/NotoSerifCJK-Medium.ttc: Noto Serif CJK JP,Noto Serif CJK JP Medium:style=Medium,Regular
/usr/share/fonts/opentype/noto/NotoSansCJK-Light.ttc: Noto Sans CJK TC,Noto Sans CJK TC Light:style=Light,Regular
;