Ubuntu – Gtk-update-icon-cache: The generated cache was invalid

cachegtkgtk3icon-themes

i'm working on some editing icon theme and when i want to update the icon cache i got this error :

gtk-update-icon-cache: The generated cache was invalid.
WARNING: icon cache generation failed for /usr/share/icons/test-ico

so i made a double check to theme.index file and compared the files name and directories in it and tried to add -f , -t and -q to my command :

sudo gtk-update-icon-cache -q -t -f  /usr/share/icons/test-ico

but i still got the same error and warning message.

so how can i find the error cause to fix it ?

Best Answer

  • You need to check two things :

    1. The name of icons directories in theme.index file like (apps/24x24, places/128x128 ... etc) if they listed in index file and dose not exist in icons directory ( or vis versa)

    2. The names of icons images if they have a white spaces or some thing like this

    As you said, you made a double check for theme.index file and dirs, so you need to check the images names. for me I use this command inside the icon dir :

    ls -a -R * > ~/outfile.txt
    

    to list all images names, after that I replace the white spaces with (@) symbol using my text editor to find and fix the images names.