由于业务决策,我们必须将 RHEL 服务器迁移到 CentOS。 RHEL6 到 CentOS6 看起来非常简单,但我们在尝试从 RHEL7 迁移到 CentOS7 时遇到了各种错误。我们尝试通过从镜像下载以下文件来匹配我们找到的有关 rhel6 到 centos6 转换的各种指南:
centos-indexhtml-7-9.el7.centos.noarch.rpm
centos-logos-70.0.6-3.el7.centos.noarch.rpm
centos-release-7-4.1708.el7.centos.x86_64.rpm
python-urlgrabber-3.10-8.el7.noarch.rpm
redhat-support-lib-python-0.9.7-6.el7.noarch.rpm
redhat-support-tool-0.9.9-3.el7.noarch.rpm
rpm-4.11.3-25.el7.x86_64.rpm
rpm-build-libs-4.11.3-25.el7.x86_64.rpm
rpm-devel-4.11.3-25.el7.x86_64.rpm
rpm-libs-4.11.3-25.el7.x86_64.rpm
rpm-python-4.11.3-25.el7.x86_64.rpm
yum-3.4.3-154.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-42.el7.noarch.rpm
到一个目录中。
我们有一个正在使用的脚本,如下所示:
cd "$CENTOS7DIR"
rpm --import RPM-GPG-KEY-CentOS-7
yum remove rhnlib abrt-plugin-bugzilla redhat-release-notes* redhat-support-tool redhat-support-lib-python -y
[[ "$(rpm -qa | grep redhat-release-server)" ]] && rpm -e --nodeps redhat-release-server
rm -fr /usr/share/doc/redhat-release*
[[ "$(rpm -qa | grep subscription-manager)" ]] && subscription-manager clean
[[ "$(rpm -Uvh --force *.rpm)" ]] || { rpm -fr /usr/share/doc/redhat-release* && rpm -Uvh --force *.rpm; }
[ "$(find /etc/yum.conf.rpmnew -mmin +0.6 )" ] && mv /etc/yum.conf.rpmnew /etc/yum.conf
[[ "$(rpm -qa | grep subscription-manager)" ]] && yum remove subscription-manager -y
yum clean all
yum -y upgrade
grub2-mkconfig -o /boot/grub2/grub.cfg
但是当到达 时yum -y upgrade
,新的 centos7 yum 下载了升级所需的所有文件后,我们遇到了这些事务错误:
Transaction check error:
file /usr/share/man/man5/limits.conf.5.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man5/pam_env.conf.5.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/faillock.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/pam_env.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/pam_exec.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/pam_faillock.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/pam_unix.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/pam_userdb.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
file /usr/share/man/man8/pwhistory_helper.8.gz from install of pam-1.1.8-18.el7.i686 conflicts with file from package pam-1.1.8-18.el7.x86_64
Error Summary
-------------
请问我们做错了什么,我们该如何解决这个问题?
答案1
今天早上也做了同样的事情。运行重新安装:
yum reinstall pam.x86_64
然后您应该能够毫无问题地升级系统。