Deleted /usr/include by mistake
Like a real idiot, I deleted my
/usr/include
on 13.04, is there anyway I can retrieve this?
12 Answers
/usr/include contains data about your packages, which means that a fresh install wouldn't write anything to it. I'm afraid your system has suffered a great loss.
Maybe you could try an update for your packages, but from experience, I know this doesn't usually work with Ubuntu.
sudo apt-get update
sudo apt-get upgradeIf your lucky, the apt cache will still have information about packages that used /usr/include. You can find a list using dpkg -S /usr/include/*, and use sudo apt-get reinstall [package] to fix things.
Edit : Best solution found in the comments :
sudo apt-get install --reinstall $(dpkg -S /usr/include/*|cut -d':' -f1|tr -d ','|tr '\n' ' ')In order to reinstall all packages that where corrupted.
9Hi (and thanks for solution), some additional commands used by me:
dpkg -S /usr/include/*|cut -d':' -f1|tr -d ','|tr '\n' ' ' > app.list
cat app.list | tr ' ' '\n' | sort | uniq > sortapp.list
cat sortapp.list | tr '\n' ' ' > sortapp-2.list
sudo apt update
sudo apt-get install --reinstall $( cat sortapp-2.list )