Record a thrilling process of glibc mistakenly deleted

The system is redhat6.7, I don't know who pointed the yum source to centos7.5. I have no idea. Installed lrzsz
#yum install lrzsz -y
ssh was abnormal immediately. I dare not exit a ssh login window currently in use. I did the following:
first change the yum source back to use the correct one, and then;
#rpm -qa |grep bash
bash-4.2.46-30.el7.x86_64. rpm
#rpm -e --nodpes bash-4.2.46-30.el7.x86_64.rpm
#yum install bash -y

ssh is back to normal.

But I did another devastating action:
#rpm -qa |grep glibc
glibc-2.17-222.el7.x86_64.rpm
#rpm -e --nodeps glibc-2.17-222.el7.x86_64.rpm
As a result, the system It collapsed, no order is valid. Both are bad interpreter: No such file or directory... errors

Repair process: (fortunately restore the bash earlier, otherwise it will be more troublesome)
CD boot, choose: Rescue
keep clicking to enter sh mode and enter:
#mkdir /media
#mount /dev/cdrom /media (the physical machine in the computer room is actually /dev/ cdrom1, this depends on the actual environment)
#cd /media/Package
#rpm -ivh glibc*.rpm --root /mnt/sysimage --nodeps --force

Note: When the virtual machine simulates the operation, there is no problem at this step, but when I go to the physical machine in the computer room, this pop-up:
error:cant't create transaction lock on /mnt/sysimage/var/lib/rpm/.rpm. lock (Read-only file system)

Solution:
#mount -o remount rw /mnt/sysimage/
and then;
#rpm -ivh glibc*.rpm --root /mnt/sysimage --nodeps --force
#reboot After restarting the problem is solved

Record a thrilling process of glibc mistakenly deleted

Guess you like

Origin blog.51cto.com/devin223/2554739