CentOS mistakenly deletes glibc and causes a series of errors in the system

Because the upgrade of glibc was unsuccessful, the old version of glibc was deleted, so most of the commands in the system could not be used, and the system could not be started normally.
The solution is as follows:
System: CentOS release 6.5 (Final)
Kernel: 2.6.32-431.el6.x86_64
Insert the system disk and select the system rescue mode.
By default, the original operating system will be hung in the /mnt/sysimage directory
#chroot /mnt/ sysimage //Switch to the original operating system
#mkdir /mnt/cdrom //Create a CD-ROM mount directory
#mount /dev/sr0 /mnt/cdrom //Mount the CD-ROM drive
#cd /mnt/cdrom/Packeges #ls
glibc //View What are the rpm packages
of glibc #cp glibc
/mnt/sysimage/root //Copy the rpm package of glibc to the root directory
#cd /mnt/sysimage/root //If there is a util.repo file or a util directory in the root directory is deleted.
#rpm2cpio glibc-2.12-1.132.el6.x86_64.rpm > util.repo //Make the glibc-2.12-1.132.el6.x86_64.rpm package into a file in repo format
#mkdir util //in /mnt/sysimage/root Create a util directory in the directory #cd
util
#cpio -idcuv < ../util.repo //Unzip util.repo
#cp -r /mnt/sysimage/root/util/lib64 /mnt/sysimage/lib64 //Copy all files
#cd /mnt/sysimage/root //Go back to the root directory
and install the rpm package of glibc in the root directory in turn
# rpm -ivh glibc-common-2.12-1.132.el6.x86_64.rpm
#rpm -ivh glibc-2.12-1.132.el6.x86_64.rpm
#rpm -ivh glibc-devel-2.12-1.132.el6.x86_64.rpm
#rpm -ivh glibc-headers-2.12-1.132.el6.x86_64.rpm
#rpm -ivh glibc-utils-2.12-1.132.el6.x86_64.rpm
If there are other dependency errors during the installation process, you can add the following parameters to force Installation:
--force --nodeps
#cd /mnt/cdrom/Packeges #ls
libgcc
//Find libgcc-4.7.0-1.fc17.x86_64.rpm
#cp libgcc-4.7.0-1.fc17.x86_64. rpm /mnt/sysimange/root //Copy it to /mnt/sysimage/root directory #cd
/mnt/sysimage/root
#rpm -ivh libgcc-4.7.0-1.fc17.x86_64.rpm
Three rpm packages must be installed:
glibc-common-2.12-1.132.el6.x86_64.rpm
glibc-2.12-1.132.el6.x86_64.rpm
libgcc-4.7.0-1.fc17.x86_64.rpm
restart the system, the system returns to normal , there may be multiple restarts during the restart process.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325347859&siteId=291194637