Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Like a real idiot, I deleted my


on 13.04, is there anyway I can retrieve this?

share|improve this question
up vote 1 down vote accepted

/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 upgrade

If 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.

share|improve this answer
Hi thanks I ran dpkg -S /usr/include/* and got a massive list, how do I use this information with sudo apt-get reinstall [package] ? – Radagasp Jul 14 '13 at 21:43
The list you got is the list of packages that used things in /usr/include. By reinstalling it, you'll repopulate them. Think about recreating /usr/include if you deleted the directory (as root). You could do something like sudo apt-get reinstall $(dpkg -S /usr/include/*|cut -d':' -f1|tr -d ','|tr '\n' ' ') but keep in mind that it is RISKY. – John WH Smith Jul 14 '13 at 21:55
thanks it says, apt-get reinstall is an invalid operation – Radagasp Jul 14 '13 at 22:04
My bad. sudo apt-get install --reinstall $(dpkg -S /usr/include/*|cut -d':' -f1|tr -d ','|tr '\n' ' ') - Still as RISKY – John WH Smith Jul 14 '13 at 22:05
Perhaps I should do a back up first? – Radagasp Jul 14 '13 at 22:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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