First, I did something stupid. Not once, but twice! I copied a new libc-2.19.so Library to my /lib64 Folder and tried to change the link from libc-2.12.so to libc-2.19.so. I wrote:
unlink /lib64/libc.so.6 && ln -s /lib64/libc-2.19.so /lib64/libc.so.6
And … BAM! No command was usable after unlinking libc.so.6! It could not create the new link, because ln was itself depending on libc.so.6! And now you’re left with simply root-bash. But exactly this – was my saviour!
Second, Another mistake! I tried to copy the libc-2.19.so file into a new libc.so.6 (which was missing). BAM! I created a file with no way of deleting it for further correction! I was stuck! And the best – I tried to:
echo /lib64/libc-2.19.so >/lib64/libc.so.6
which copied the “string” /lib64/libc-2.19.so into the file libc.so.6! How could I ? What was I thinking ?
Goodness. Then some bash-saints showed themselves to me and some tricks to my shell:
- If you deleted your libc.so.6 link – just use ldconfig. It creates your libc.so.6
- If you’ve created a wrong libc.so.6 this is not possible!
Okay. So LD_PRELOAD loads a library in front of every other library. I could remove my silly error:
LD_PRELOAD=/lib64/libc-2.12.so /bin/rm /lib64/libc.so.6
which deleted my failing libc.so.6 link and
ldconfig -l -v /lib64/libc-2.12.so
which created my libc.so.6 again. I was saved! Thank you bash-god. It is really working! One thing at last – If you try to copy the content of a file to another file with echo, try this:
echo $(</lib64/libc-2.12.so) >/lib64/libc-2.12.so-backup
And another thing: Version libc-2.19.so did not work for my system. I’m stuck again with libc-2.12.so. Missing symbols included.
Don’t you fiddle with your system! It’s dangerous if you don’t know how to repair it!