Damaged libc6 how do I recover?

Situation:
libc6 got damaged for reasons unknown on a server. I pinpointed the problem to that accurately so it is nothing else. Obviously with libc6 damaged, I could not use terminals etc as I will just get a segmentation fault error if I type any command in the running server. Obviously I cannot reboot as it wont boot with corrupt libc, which unfortunately I tried. Unfortunately my system backup is corrupt for that server.

QUESTION: Given the above situation and the fact that I can boot into another Linux Admin OS on the same server and disk. Is it possible to force a reinstall libc6 from the Admin Linux distro to the other distro partition where the damaged libc6 resides.?

I saw during a websearch for a similar problem the solution, that is too cryptic.

Blockquote Use apt-get download libc6 to get the package, then
dpkg -x libc6*.dpkg /partition_path
to “install” it.

That looks easy but the problem for me is how do I reinstall a package from an Active Admin Linux distro to another inactive distro residing on another partition (as that wont boot anymore) and I cannot make out if the above solution actually addresses it.? It is something I never did before. It is a nasty problem that can easily be solved if I can somehow reinstall libc6 on an inactive distro on a partition from an active distro on another partition.

Any help will be appreciated.

I fouind the solution by myself.

I will post the procedure.

All my backups were corrupt (I will have to investigate that as it is peculiar) and I managed to get out of this one without any data loss whatsoever and could install libc6 while the server was running a completely different distro on another partition. I never knew this is possible, but it opens up a huge tool for correcting broken libraries that cannot be done while the OS is running.

Do post your solution when free. Thanks!

Nixcraft,
I will do so in detail. I will have to set up a distro on a test machine and break libc6 and then demonstrate how to do it from another distro so it will take a bit of time till I am there. I will then possibly rename this thread and take out the post which are not relevant anymore such as this one so everybody can use the info.


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki