I was trying to get SFML working on fedora 24, and I accidentally deleted the usr/include directory in the process. Is there any way to reinstall all the missing files? Or do I have to reinstall the whole OS? I have tried running sudo dnf --exclude=kernel\* reinstall \* and it seemed to fix some of the problem but I am still missing a lot of the files that were in that directory originally. Is there any way to reinstall everything without reinstalling the whole OS?

1 Answer 1


You can make a list of the packages whose include-files are missing by using the "verify" feature of rpm.

Something like this:

rpm -qa|while read name
    include=$(rpm -ql "$name" |grep -E '^/usr/include/' |wc -l)
    [ $include = 0 ] && continue
    missing=$(rpm -V "$name" |grep -E '^missing[[:space:]]+/usr/include/' |wc -l)
    [ $missing = 0 ] && continue
    printf '# missing %d of %d %s\n' $include $missing $name
    printf "sudo dnf -y reinstall %s\n" $name

It prints a script with comments indicating the number of missing files, as well as commands for reinstalling the broken packages. Here is an example:

# missing 1 of 1 libXcomposite-devel-0.4.4-7.fc23.x86_64
sudo dnf -y reinstall libXcomposite-devel-0.4.4-7.fc23.x86_64
  • That worked perfectly! It looks like everything is there again. Thanks for the quick reply :)
    – JRud52
    Aug 21, 2016 at 18:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.