sonia hamilton – linux, brazilian jiu jitsu

9 September 2007

/usr/share/fonts: failed to write cache

Filed under: Uncategorized — Sonia Hamilton @ 14:48

After doing a fresh install of Ubuntu 7.04 and installing all pending updates via Update Manager, I get an error that starts like this:

Setting up ttf-opensymbol (2.2.0-1ubuntu4) ...
Updating fontconfig cache...
/usr/share/fonts: failed to write cache
/usr/share/fonts/X11: failed to write cache

I’ve had this occur on several machines, and the md5 on the .iso checks out ok, so it’s a bug (Bug 104553, Bug 122976) caused by incorrect dates on the font cache. There’s a solution documented here, but it needs a bit of fixing:

$ sudo bash
# wget -O folder_list.txt
# cat folder_list.txt | xargs touch
# cd /usr/share/fonts/truetype
# for i in * ; do touch ${i}; done
# cd /var/lib/defoma/fontconfig.d
# for i in * ; do touch ${i}; done
# apt-get dist-upgrade

Another post suggests this simpler solution:

$ sudo bash
# find /usr/share/fonts /usr/local/share/fonts /var/lib/defoma/fontconfig.d -type d -print0 | xargs --null touch



  1. Same thing after updating a fresh install of 7.10 today (2 jan 2008)
    Solved like this:

    #cd /var/lib/defoma/fontconfig.d
    #sudo touch *
    #apt-get install


    Comment by Tycho — 2 January 2008 @ 08:27 | Reply

  2. This worked great for me on a new install of gutsy. Thanks!

    Comment by harper — 3 January 2008 @ 01:11 | Reply

  3. Thanks for this “howto”-fix,

    works great 🙂

    Comment by Mat — 3 February 2008 @ 09:40 | Reply

  4. Worked for me on Ubuntu 7.10:

    find /usr/share/fonts /usr/local/share/fonts /var/lib/defoma/fontconfig.d -type d -print0 | sudo xargs –null touch

    Comment by Rafael Gattringer — 13 July 2008 @ 10:21 | Reply

  5. Remark: –null consists of two hyphens!
    — null

    Comment by Rafael Gattringer — 13 July 2008 @ 10:24 | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at

%d bloggers like this: