DEV Community

Serhat Teker
Serhat Teker

Posted on • Originally published at tech.serhatteker.com on

Install Fonts in Linux

There may be different directories on different systems/distributions to install your fonts.

To get the list of font files and paths that your OS uses:

$ fc-list -f '%{file}\n' | sort
Enter fullscreen mode Exit fullscreen mode

If we take Ubuntu as an example, paths will be like:

  • ~/.local/share/fonts/ — fonts for particular user, local user
  • /usr/local/share/fonts/ — fonts for all users, systemwide

Copy your fonts under one of the directories above and reboot the system. If you don't want to reboot, cache them manually by running:

$ sudo fc-cache -fv
Enter fullscreen mode Exit fullscreen mode

Also many fonts are packaged for Ubuntu available via the "Fonts" category of the "Ubuntu Software Center". If you prefer apt-get, search for packages starting with "otf-" or "ttf-" and install them.

You can also double-click on the font file (or select "Open with Font Viewer" in the right-click menu). Then click the "Install Font" button.

After installation you can confirm they are installed correctly:

$ fc-list | grep <name-of-font>
Enter fullscreen mode Exit fullscreen mode

You may need to restart some programs, like Visual Studio Code, before they actually show the new fonts. Usually such programs are caching the font list when they start up.

OK, All done!

Oldest comments (0)