2021-05-12 14:32:11
RHEL6誤安裝RHEL7包導致glibc被升級後系統崩潰處理方法
RHEL6誤使用了RHEL7的光碟源,安裝了某個RPM包之後,導致glibc被升級,進而導致系統崩潰。
yum install升級記錄紀錄檔
[root@rhel65 ~]# yum install ftp
Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package ftp.x86_64 0:0.17-67.el7 will be installed
--> Processing Dependency: libc.so.6(GLIBC_2.15)(64bit) for package: ftp-0.17-67.el7.x86_64
--> Running transaction check
---> Package glibc.x86_64 0:2.12-1.132.el6 will be updated
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-headers-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-common-2.12-1.132.el6.x86_64
--> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-devel-2.12-1.132.el6.x86_64
---> Package glibc.x86_64 0:2.17-157.el7 will be an update
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-common.x86_64 0:2.17-157.el7 will be an update
--> Processing Dependency: /usr/bin/bash for package: glibc-common-2.17-157.el7.x86_64
---> Package glibc-devel.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-devel.x86_64 0:2.17-157.el7 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.132.el6 will be updated
---> Package glibc-headers.x86_64 0:2.17-157.el7 will be an update
--> Running transaction check
---> Package bash.x86_64 0:4.1.2-15.el6_4 will be updated
---> Package bash.x86_64 0:4.2.46-20.el7_2 will be an update
--> Processing Conflict: bash-4.2.46-20.el7_2.x86_64 conflicts filesystem < 3
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package filesystem.x86_64 0:2.4.30-3.el6 will be updated
---> Package filesystem.x86_64 0:3.2-21.el7 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
===========================================================================================================
Package Arch Version Repository Size
===========================================================================================================
Installing:
ftp x86_64 0.17-67.el7 rhel73-iso 61 k
Updating:
filesystem x86_64 3.2-21.el7 rhel73-iso 1.0 M
Updating for dependencies:
bash x86_64 4.2.46-20.el7_2 rhel73-iso 1.0 M
glibc x86_64 2.17-157.el7 rhel73-iso 3.6 M
glibc-common x86_64 2.17-157.el7 rhel73-iso 11 M
glibc-devel x86_64 2.17-157.el7 rhel73-iso 1.1 M
glibc-headers x86_64 2.17-157.el7 rhel73-iso 668 k
Transaction Summary
===========================================================================================================
Install 1 Package(s)
Upgrade 6 Package(s)
Total download size: 19 M
Is this ok [y/N]: y
Downloading Packages:
-----------------------------------------------------------------------------------------------------------
Total 120 MB/s | 19 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Updating : glibc-2.17-157.el7.x86_64 1/13
Updating : bash-4.2.46-20.el7_2.x86_64 2/13
Updating : glibc-common-2.17-157.el7.x86_64 3/13
Updating : glibc-headers-2.17-157.el7.x86_64 4/13
Updating : glibc-devel-2.17-157.el7.x86_64 5/13
Updating : filesystem-3.2-21.el7.x86_64 6/13
Error unpacking rpm package filesystem-3.2-21.el7.x86_64
error: unpacking of archive failed on file /bin: cpio: rename
Installing : ftp-0.17-67.el7.x86_64 7/13
Cleanup : glibc-devel-2.12-1.132.el6.x86_64 8/13
Cleanup : glibc-headers-2.12-1.132.el6.x86_64 9/13
Cleanup : bash-4.1.2-15.el6_4.x86_64 10/13
Non-fatal POSTUN scriptlet failure in rpm package bash
Cleanup : glibc-common-2.12-1.132.el6.x86_64 11/13
warning: %postun(bash-4.1.2-15.el6_4.x86_64) scriptlet failed, exit status 127
Cleanup : glibc-2.12-1.132.el6.x86_64 12/13
warning: /etc/localtime saved as /etc/localtime.rpmsave
Non-fatal <unknown> scriptlet failure in rpm package glibc
rhel65-iso/productid | 1.7 kB 00:00 ...
rhel73-iso/productid | 1.6 kB 00:00 ...
Verifying : glibc-devel-2.17-157.el7.x86_64 1/13
Verifying : bash-4.2.46-20.el7_2.x86_64 2/13
Verifying : glibc-2.17-157.el7.x86_64 3/13
Verifying : glibc-common-2.17-157.el7.x86_64 4/13
Verifying : ftp-0.17-67.el7.x86_64 5/13
Verifying : glibc-headers-2.17-157.el7.x86_64 6/13
Verifying : glibc-2.12-1.132.el6.x86_64 7/13
Verifying : glibc-devel-2.12-1.132.el6.x86_64 8/13
Verifying : bash-4.1.2-15.el6_4.x86_64 9/13
filesystem-2.4.30-3.el6.x86_64 was supposed to be removed but is not!
Verifying : filesystem-2.4.30-3.el6.x86_64 10/13
Verifying : glibc-common-2.12-1.132.el6.x86_64 11/13
Verifying : glibc-headers-2.12-1.132.el6.x86_64 12/13
Verifying : filesystem-3.2-21.el7.x86_64 13/13
Installed:
ftp.x86_64 0:0.17-67.el7
Dependency Updated:
bash.x86_64 0:4.2.46-20.el7_2 glibc.x86_64 0:2.17-157.el7 glibc-common.x86_64 0:2.17-157.el7
glibc-devel.x86_64 0:2.17-157.el7 glibc-headers.x86_64 0:2.17-157.el7
Failed:
filesystem.x86_64 0:2.4.30-3.el6 filesystem.x86_64 0:3.2-21.el7
Complete!
此時系統已經不能正常執行reboot命令重新啟動了,只能強制按電源重新啟動機器。重新啟動之後,原系統已經崩潰,進不去系統了,停在下面的介面:
然後使用RHEL6的光碟引導機器,選擇rescue,進入到shell之後提示無法chroot到/mnt/sysimage,無解。
然後重新啟動,用RHEL6安裝光碟引導機器,選擇Install or Update系統,進入圖形後選擇update已有系統,失敗,如下圖。
然後按ctrl+alt+F2切換到第2個console,發現原系統已經被自動掛載到/mnt/sysimage目錄,嘗試chroot到/mnt/sysimage,由於bash被上面依賴更新了,所以會提示找不到/bin/sh,手動把/mnt/sysimage/usr/bin/sh 拷到 /mnt/sysimage/bin/sh,再次chroot成功。
手工掛載RHEL6的ISO到/mnt/rhel65並cd到Packages目錄,強制將上面更新過的幾個包更新回到RHEL6的版本:
# rpm --force --nodeps -Uvh [RPM包名]
分別把bash/glibc/glibc-common/glibc-devel/glibc-headers這幾個包裝回去。
重新啟動系統,發現已經可以正常進入到原系統了,最後使用yum remove把最開始安裝的RHEL7的包給remove掉,問題全部解決。
相關文章