Skip to content

Instantly share code, notes, and snippets.

@flying-sheep
Created September 29, 2011 14:41
Show Gist options
  • Save flying-sheep/1250868 to your computer and use it in GitHub Desktop.
Save flying-sheep/1250868 to your computer and use it in GitHub Desktop.
A bug exists for ages in Kubuntu (and afaik only there) that can be fixed by removing a superfluous file and rebuilding the MIME DB.
#!/bin/bash
ROOT_UID=0
FIX_JAR_MIME="rm -vf /usr/share/mime/packages/sun-java*-jre.xml
update-mime-database /usr/share/mime"
if [ "$UID" -ne "$ROOT_UID" ]; then
kdesudo -c "$FIX_JAR_MIME"
kbuildsycoca4 #only possible if run as underprivileged
else
"$FIX_JAR_MIME"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment