How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Issues related to applications and software problems
Post Reply
postcd
Posts: 24
Joined: 2014/10/11 11:45:27

How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Post by postcd » 2019/03/29 10:25:21

Hello, this is CentOS release 6.7 and there was an error after removing glibc (wanted to use newer version not offered by yum):
# rpm -qa | grep "glibc"
glibc-2.12-1.212.el6.x86_64
glibc-common-2.12-1.212.el6.x86_64
glibc-devel-2.12-1.212.el6.x86_64
glibc-headers-2.12-1.212.el6.x86_64
glibc-2.12-1.212.el6.i686
vzdummy-glibc-2.12-1.7.el6.noarch

# rpm -e --nodeps glibc-2.12-1.212.el6.x86_64
warning: %postun(glibc-2.12-1.212.el6.x86_64) scriptlet failed, exit status 127

# rpm -qa | grep "glibc"
-bash: /bin/grep: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory
-bash: /bin/rpm: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

# wget https://url.here/file
-bash: /usr/bin/wget: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

# rpm -i glibc-2.12-1.212.el6.x86_64
-bash: /bin/rpm: /lib64/ld-linux-x86-64.so.2: bad ELF interpreter: No such file or directory

# yum install glibc
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
after closing session, i may no longer login. i may login again after copying files of the /lib64/ directory of the working CentOS installation to non working one

But yum is corrupted and possibly other things too:
Total download size: 4.4 M
Installed size: 13 M
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in <module>
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 300, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 229, in main
return_code = base.doTransaction()
File "/usr/share/yum-cli/cli.py", line 494, in doTransaction
if self.conf.assumeno or not self.userconfirm():
AttributeError: 'YumConf' object has no attribute 'assumeno'
Please how can i again install glibc-2.12-1.212.el6.x86_64 or if impossible, which files are part of it so i copy them manually from working installation?

stevemowbray
Posts: 519
Joined: 2012/06/26 14:20:47

Re: How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Post by stevemowbray » 2019/03/29 11:40:18

glibc is fundamental to the operating system and pretty much everything depends on it so your system might not be recoverable. However, you can find a list of files in the package using "rpm -ql glibc" on a working system. If things do seem to be working after copying files you should "yum install glibc" and then check the integrity of your system using at least "rpm -Va".

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Post by TrevorH » 2019/03/29 12:58:50

This is a completely unsupported action. The system depends on glibc in many many different places and replacing it is almost guaranteed to screw your system up completely. The install media is still available for download - you're almost certainly going to need it.

If you need a newer glibc then move to CentOS 7 which has 2.17.

Also, 6.7 is from 2015 and thus you are missing nearly 4 years of fixes, both security related and enhancements etc. The current CentOS 6 is 6.10. Run yum update more often than every 4 years please.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

postcd
Posts: 24
Joined: 2014/10/11 11:45:27

Re: How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Post by postcd » 2019/03/29 13:45:04

> "rpm -ql glibc" on a working system
i did it and it returned 672 files

so i pasted these into a file and ran command that will copy files from a working system to damaged:
for file in $(cat libgcfiles);do echo "cp -np /vz/private/4640$file /vz/private/1120/";done

that shown all the commands i am looking to execute. (-n skip existing ; -p preserve permissions)
the systems was not running

It was looking ok, so i executed:
for file in $(cat libgcfiles);do cp -np /vz/private/4640"$file" /vz/private/1120"$file";done

it omitted some files and some could not copy.

I started the "corrupted" system and tried "yum install glibc", result:
Package matching glibc-2.12-1.212.el6.x86_64 already installed. Checking for update.
Nothing to do
"yum update" continue to end with mentioned error. I was thinking if it can fix to install some glibc package using rpm or anything else. (i am still in progreess of integrity checking: rpm -Va)

postcd
Posts: 24
Joined: 2014/10/11 11:45:27

Re: How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Post by postcd » 2019/03/29 17:11:20

i thought i can also try to copy other system directory files, but i did not know which (if anyone know, let me know).
i ended up restory my snapshot backup 1 month old, i still have this corrupted snapshot if anyone will get idea on what can fix the issue.
Or if you know a command to compare certain dirrectories of two operating systems (corruped one and restored backup - there were almost no system changes between these two) i will ran it so we know what was missing (if that is important).

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to fix damaged system by removing glibc-2.12-1.212.el6.x86_64?

Post by TrevorH » 2019/03/29 17:18:23

Just don't do what you tried to do. No-one here is going to try to debug such a trainwreck. It's junk, throw it away and forget about trying to do this.

If you need a newer glibc then use CentOS 7.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply