How to fix 'Fontconfig warning' errors in Linux

Two things to check to fix annoying Fontconfig warning errors...

fontconfig error
Credit: Florent Darrault (CC BY-SA 2.0)

If you've ever encountered a Fontconfig warning similar to the line below, there are a couple changes you can make to prevent and fix this annoying problem in Linux.

Fontconfig warning: "/etc/fonts/conf.d/50-user.conf", line 9: reading configurations from ~/.fonts.conf is deprecated.  

fontconfig warning 50-user conf Stephen Glasskeys

Create folder, move file

Older versions of Fontconfig expected the configuration file (.fonts.conf) to be in the user's home directory. Now, Fontconfig expects this file -- renamed fonts.conf -- in the ~/.config/fontconfig directory.

So run these commands to create the folder, as well as move (and rename) the conf file to the new, proper, location:  

# mkdir ~/.config/fontconfig
# mv ~/.fonts.conf ~/.config/fontconfig/fonts.conf
fontconfig warning mkdir and mv commands Stephen Glasskeys

Edit config file

On many systems the Fontconfig warning gripes about a file named 50-user.conf file, located in /etc/fonts/conf.d.

So, if you continue to see the Fontconfig warning -- even after creating the new ~/.config folders -- you probably need to comment two lines that reference the old deprecated location:

<include ignore_missing="yes" deprecated="yes">~/.fonts.conf.d</include>
<include ignore_missing="yes" deprecated="yes">~/.fonts.conf</include>
fontconfig warning edit 50-user conf Stephen Glasskeys

This article is published as part of the IDG Contributor Network. Want to Join?

Related:
ITWorld DealPost: The best in tech deals and discounts.
Shop Tech Products at Amazon