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?
Accidentally deleted /usr/include. What can I do to reinstall the files that were in that directory?
1 Answer
You can make a list of the packages whose include-files are missing by using the "verify" feature of rpm
.
Something like this:
#!/bin/sh
rpm -qa|while read name
do
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
done
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 :)– JRud52Aug 21, 2016 at 18:44