update-mime-database was getting very slow recently, so I decided to remove all associations and start over, thus I ran:

sudo rm -fr /usr/share/mime /usr/share/mime-info /usr/share/mimelnk

I thought that update-mime-database would notice that and just create blank directories instead, but it didn't and instead complains: "directory '/usr/share/mime/packages' does not exist!".

What do I do?

  • 2
    Reinstall the shared-mime-info package? Apr 19 '17 at 11:49
  • This bug report for an unrelated library suggests that they fixed it by just doing a mkdir -p /usr/share/mime/packages. But I agree that you should just reinstall the package. Apr 19 '17 at 11:52
  • @steeldriver Tanks! It worked!
    – user679994
    Apr 19 '17 at 12:08

The /usr/share/mime directory and its /usr/share/mime/packages subdirectory are provided by package shared-mime-info so to fix the error it should be sufficient to re-install the package - either from your favorite GUI package manager or from the command line using

sudo apt-get install --reinstall shared-mime-info

If you want to restore /usr/share/mime-info and /usr/share/mimelnk as well, then they appear to belong to libreoffice-common

Other packages may have installed their own files underneath /usr/share/mime - to identify these, you can use

dpkg -S /usr/share/mime

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy