RHEL6误安装RHEL7的包导致glibc被升级后系统崩溃处理方法

2018-03-02 08:27:15来源:cnblogs.com作者:Sunny_zhufeng人点击

分享
RHEL6误使用了RHEL7的光盘源,安装了某个RPM包之后,导致glibc被升级,进而导致系统崩溃。
[[email protected] ~]# yum install ftpLoaded plugins: product-id, refresh-packagekit, security, subscription-managerThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.Setting up Install ProcessResolving 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 ResolutionDependencies Resolved===========================================================================================================Package                    Arch                Version                      Repository               Size===========================================================================================================Installing:ftp                        x86_64              0.17-67.el7                  rhel73-iso               61 kUpdating:filesystem                 x86_64              3.2-21.el7                   rhel73-iso              1.0 MUpdating for dependencies:bash                       x86_64              4.2.46-20.el7_2              rhel73-iso              1.0 Mglibc                      x86_64              2.17-157.el7                 rhel73-iso              3.6 Mglibc-common               x86_64              2.17-157.el7                 rhel73-iso               11 Mglibc-devel                x86_64              2.17-157.el7                 rhel73-iso              1.1 Mglibc-headers              x86_64              2.17-157.el7                 rhel73-iso              668 kTransaction Summary===========================================================================================================Install       1 Package(s)Upgrade       6 Package(s)Total download size: 19 MIs this ok [y/N]: yDownloading Packages:-----------------------------------------------------------------------------------------------------------Total                                                                      120 MB/s |  19 MB     00:00     Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning 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/13Error unpacking rpm package filesystem-3.2-21.el7.x86_64error: 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/13Non-fatal POSTUN scriptlet failure in rpm package bash  Cleanup    : glibc-common-2.12-1.132.el6.x86_64                                                    11/13warning: %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/13warning: /etc/localtime saved as /etc/localtime.rpmsaveNon-fatal <unknown> scriptlet failure in rpm package glibcrhel65-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/13filesystem-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/13Installed:  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.el7Failed:  filesystem.x86_64 0:2.4.30-3.el6                      filesystem.x86_64 0:3.2-21.el7                     Complete!
查看yum install升级记录日志  此时系统已经不能正常执行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掉,问题全部解决。 

相关文章

    无相关信息

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台