用 fc-cache 重建字体缓存

安装字体后运行 fc-cache -f,让应用立即识别新字体,无需注销。

Linux缓存字体桌面fc-cache 字体缓存低风险
把字体文件复制到 ~/.local/share/fonts/ 后,运行 `fc-cache -f` 即可立即生效。

01命令

命令
$ fc-cache -f -v

02作用说明

fontconfig 会为每个字体目录维护元数据缓存,应用读取的是缓存而不是重新扫描目录,所以新放的 TTF/OTF 文件会“看不见”,直到重建缓存。`-f` 强制全量重新扫描,`-v` 显示扫描了哪些目录。用 `fc-list | grep -i <名称>` 验证字体已被识别——已经打开的应用可能仍需重启才会列出新的字体族。

03风险

风险低风险
使用条件fontconfig. Drop fonts into ~/.local/share/fonts/ (per-user) or /usr/local/share/fonts/ (all users) before running.

04撤销

✓无需撤销——该命令不会改变持久状态。

05来源

  • fc-cache(1) - Linux manual page
    Ubuntu Manpages · technical · 2026-09-17
    依据: fc-cache scans the font directories and builds font information cache files; -f forces rescan ignoring the cache, -v reports directories scanned.

最后验证: 2026-09-18 · 分类: 系统与设置

06相关方案