「findfont: Generic family 'sans-serif' not found because none of the following families were found: CMU Bright」に対する対処法の紹介
エラー
Ubuntuでとあるプログラムを実行しようとしたらこんなエラーが出た
findfont: Generic family 'sans-serif' not found because none of the following families were found: CMU Bright
原因
フォント「CMU Bright」がインストールされていない
対処法
CMU Brightをインストールして,キャッシュを削除する
sudo apt update
sudo apt install fonts-cmu
rm ~/.cache/matplotlib -rf
:~$ sudo apt update
[sudo] password for mtkbirdman:
Get:1 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [108 kB]
Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [1818 kB]
Get:6 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [2191 kB]
Get:7 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [11.2 kB]
Get:8 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [16.0 kB]
Fetched 4373 kB in 8s (549 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
137 packages can be upgraded. Run 'apt list --upgradable' to see them.
:~$ sudo apt install fonts-cmu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
fonts-cmu
0 upgraded, 1 newly installed, 0 to remove and 137 not upgraded.
Need to get 4888 kB of archives.
After this operation, 15.3 MB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/universe amd64 fonts-cmu all 0.7.0-4 [4888 kB]
Fetched 4888 kB in 18s (273 kB/s)
Selecting previously unselected package fonts-cmu.
(Reading database ... 58986 files and directories currently installed.)
Preparing to unpack .../fonts-cmu_0.7.0-4_all.deb ...
Unpacking fonts-cmu (0.7.0-4) ...
Setting up fonts-cmu (0.7.0-4) ...
Processing triggers for fontconfig (2.13.1-2ubuntu3) ...
:~$ rm ~/.cache/matplotlib -rf
以上
404 Not Found
コメント