I was writing scripts as root user for the tar -G/-g behaviour, and I was in some /tmp directory. I knew it was wiser to use a regular user, but whatever, I already had some test environment setup and nothing really went wrong. But I wanted to test deleting and adding to and backup up and restoring large directory trees. The only large directory trees are the ones installed by the system. But, I guess, Instead of backup up one of those tries, I found it not worth the hassle although I understood the risks.
I deleted all of the directories in /usr/include/ that started with an “n”. Of course there was no real issue yet as I had a backup after all I was testing putting back backups and all. But I stopped doing that task and forgot what I had done.
Then today I was compiling some software package and it failed on <netinet/in.h> I believe. I found after a while (zypper wp didn’t work) that it belonged to glibc-devel. But it was installed. At that moment it dawned on me. But it was not over yet.
My way of restoring my backup used the -G option as I had become accustomed to use, but I’m very tired and depleted and did not Know what would happen.
The -G option deletes files that were not present in the backup. But since I had sinstalled a lot of -devel packages since, now all of those header files were gone
:D.
Since I had simply restored into /usr/include using -C /usr/include.
I go back to my compilation task and now it fails completely right away. Within seconds really I know what has happened. Bah.
So I created a list of all the -devel packages and put it into an array.
a=( zypper packages -i | grep devel | grep x86 | awk '{print $5}'
)
Then I called zypper -f on the array:
zypper in -f ${a@]}
Then I apparently also needed to reinstall automoc4, not sure.
zypper in -f automoc4.
That was a weird error. Probably a problem with cmake output still remaining when I called it again.
Now it is building for the first time :D. So happy there was an easy fix. My last backup is a while ago (the rate of change I do is too fast for it now).