RHEL6误使用了RHEL7的光盘源,安装了某个RPM包之后,导致glibc被升级,进而导致系统崩溃。
 
  1 [root@rhel65 ~]# yum install ftp
  2 Loaded plugins: product-id, refresh-packagekit, security, subscription-manager
  3 This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
  4 Setting up Install Process
  5 Resolving Dependencies
  6 --> Running transaction check
  7 ---> Package ftp.x86_64 0:0.17-67.el7 will be installed
  8 --> Processing Dependency: libc.so.6(GLIBC_2.15)(64bit) for package: ftp-0.17-67.el7.x86_64
  9 --> Running transaction check
 10 ---> Package glibc.x86_64 0:2.12-1.132.el6 will be updated
 11 --> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-headers-2.12-1.132.el6.x86_64
 12 --> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-common-2.12-1.132.el6.x86_64
 13 --> Processing Dependency: glibc = 2.12-1.132.el6 for package: glibc-devel-2.12-1.132.el6.x86_64
 14 ---> Package glibc.x86_64 0:2.17-157.el7 will be an update
 15 --> Running transaction check
 16 ---> Package glibc-common.x86_64 0:2.12-1.132.el6 will be updated
 17 ---> Package glibc-common.x86_64 0:2.17-157.el7 will be an update
 18 --> Processing Dependency: /usr/bin/bash for package: glibc-common-2.17-157.el7.x86_64
 19 ---> Package glibc-devel.x86_64 0:2.12-1.132.el6 will be updated
 20 ---> Package glibc-devel.x86_64 0:2.17-157.el7 will be an update
 21 ---> Package glibc-headers.x86_64 0:2.12-1.132.el6 will be updated
 22 ---> Package glibc-headers.x86_64 0:2.17-157.el7 will be an update
 23 --> Running transaction check
 24 ---> Package bash.x86_64 0:4.1.2-15.el6_4 will be updated
 25 ---> Package bash.x86_64 0:4.2.46-20.el7_2 will be an update
 26 --> Processing Conflict: bash-4.2.46-20.el7_2.x86_64 conflicts filesystem < 3
 27 --> Restarting Dependency Resolution with new changes.
 28 --> Running transaction check
 29 ---> Package filesystem.x86_64 0:2.4.30-3.el6 will be updated
 30 ---> Package filesystem.x86_64 0:3.2-21.el7 will be an update
 31 --> Finished Dependency Resolution
 32 
 33 Dependencies Resolved
 34 
 35 ===========================================================================================================
 36 Package                    Arch                Version                      Repository               Size
 37 ===========================================================================================================
 38 Installing:
 39 ftp                        x86_64              0.17-67.el7                  rhel73-iso               61 k
 40 Updating:
 41 filesystem                 x86_64              3.2-21.el7                   rhel73-iso              1.0 M
 42 Updating for dependencies:
 43 bash                       x86_64              4.2.46-20.el7_2              rhel73-iso              1.0 M
 44 glibc                      x86_64              2.17-157.el7                 rhel73-iso              3.6 M
 45 glibc-common               x86_64              2.17-157.el7                 rhel73-iso               11 M
 46 glibc-devel                x86_64              2.17-157.el7                 rhel73-iso              1.1 M
 47 glibc-headers              x86_64              2.17-157.el7                 rhel73-iso              668 k
 48 
 49 Transaction Summary
 50 ===========================================================================================================
 51 Install       1 Package(s)
 52 Upgrade       6 Package(s)
 53 
 54 Total download size: 19 M
 55 Is this ok [y/N]: y
 56 Downloading Packages:
 57 -----------------------------------------------------------------------------------------------------------
 58 Total                                                                      120 MB/s |  19 MB     00:00     
 59 Running rpm_check_debug
 60 Running Transaction Test
 61 Transaction Test Succeeded
 62 Running Transaction
 63   Updating   : glibc-2.17-157.el7.x86_64                                                              1/13
 64   Updating   : bash-4.2.46-20.el7_2.x86_64                                                            2/13
 65   Updating   : glibc-common-2.17-157.el7.x86_64                                                       3/13
 66   Updating   : glibc-headers-2.17-157.el7.x86_64                                                      4/13
 67   Updating   : glibc-devel-2.17-157.el7.x86_64                                                        5/13
 68   Updating   : filesystem-3.2-21.el7.x86_64                                                           6/13
 69 Error unpacking rpm package filesystem-3.2-21.el7.x86_64
 70 error: unpacking of archive failed on file /bin: cpio: rename
 71   Installing : ftp-0.17-67.el7.x86_64                                                                 7/13
 72   Cleanup    : glibc-devel-2.12-1.132.el6.x86_64                                                      8/13
 73   Cleanup    : glibc-headers-2.12-1.132.el6.x86_64                                                    9/13
 74   Cleanup    : bash-4.1.2-15.el6_4.x86_64                                                            10/13
 75 Non-fatal POSTUN scriptlet failure in rpm package bash
 76   Cleanup    : glibc-common-2.12-1.132.el6.x86_64                                                    11/13
 77 warning: %postun(bash-4.1.2-15.el6_4.x86_64) scriptlet failed, exit status 127
 78   Cleanup    : glibc-2.12-1.132.el6.x86_64                                                           12/13
 79 warning: /etc/localtime saved as /etc/localtime.rpmsave
 80 Non-fatal <unknown> scriptlet failure in rpm package glibc
 81 rhel65-iso/productid                                                                | 1.7 kB     00:00 ...
 82 rhel73-iso/productid                                                                | 1.6 kB     00:00 ...
 83   Verifying  : glibc-devel-2.17-157.el7.x86_64                                                        1/13
 84   Verifying  : bash-4.2.46-20.el7_2.x86_64                                                            2/13
 85   Verifying  : glibc-2.17-157.el7.x86_64                                                              3/13
 86   Verifying  : glibc-common-2.17-157.el7.x86_64                                                       4/13
 87   Verifying  : ftp-0.17-67.el7.x86_64                                                                 5/13
 88   Verifying  : glibc-headers-2.17-157.el7.x86_64                                                      6/13
 89   Verifying  : glibc-2.12-1.132.el6.x86_64                                                            7/13
 90   Verifying  : glibc-devel-2.12-1.132.el6.x86_64                                                      8/13
 91   Verifying  : bash-4.1.2-15.el6_4.x86_64                                                             9/13
 92 filesystem-2.4.30-3.el6.x86_64 was supposed to be removed but is not!
 93   Verifying  : filesystem-2.4.30-3.el6.x86_64                                                        10/13
 94   Verifying  : glibc-common-2.12-1.132.el6.x86_64                                                    11/13
 95   Verifying  : glibc-headers-2.12-1.132.el6.x86_64                                                   12/13
 96   Verifying  : filesystem-3.2-21.el7.x86_64                                                          13/13
 97 
 98 Installed:
 99   ftp.x86_64 0:0.17-67.el7                                                                                 
100 
101 Dependency Updated:
102   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
103   glibc-devel.x86_64 0:2.17-157.el7 glibc-headers.x86_64 0:2.17-157.el7
104 
105 Failed:
106   filesystem.x86_64 0:2.4.30-3.el6                      filesystem.x86_64 0:3.2-21.el7                     
107 
108 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掉,问题全部解决。
 

版权声明:本文为iwantcomputer原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/iwantcomputer/p/8489067.html