Star Hype News.

Premium celebrity moments with standout appeal.

news

Deleted /usr/include by mistake

By Sophia Bowman

Like a real idiot, I deleted my

/usr/include

on 13.04, is there anyway I can retrieve this?

1

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

9

Hi (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 )

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

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