有没有办法使用 yum 安装即将淘汰的软件包以及它淘汰的软件包?有几个冲突的文件,但这些软件包可以与这些文件的最新版本共存。
常规安装废弃软件包将会删除废弃软件包:
# rpm -qa | grep tc-server
vfabric-tc-server-standard-2.9.7-RELEASE.noarch
# yum -y install pivotal-tc-server-standard vfabric-tc-server-standard
---> Package pivotal-tc-server-standard.noarch 0:3.2.1-RELEASE will be obsoleting
---> Package vfabric-tc-server-standard.noarch 0:2.9.7-RELEASE will be obsoleted
...
================================================================================
Package Arch Version Repository Size
================================================================================
Installing:
pivotal-tc-server-standard noarch 3.2.1-RELEASE pivotal-app-suite 34 M
replacing vfabric-tc-server-standard.noarch 2.9.7-RELEASE
...
Running Transaction
Installing : pivotal-tc-server-standard-3.2.1-RELEASE.noarch 1/2
Erasing : vfabric-tc-server-standard-2.9.7-RELEASE.noarch 2/2
Installed:
pivotal-tc-server-standard.noarch 0:3.2.1-RELEASE
Replaced:
vfabric-tc-server-standard.noarch 0:2.9.7-RELEASE
# rpm -qa | grep tc-server
pivotal-tc-server-standard-3.2.1-RELEASE.noarch
我试过:
yum -y --setopt=obsoletes=0 install pivotal-tc-server-standard vfabric-tc-server-standard
yum -y install pivotal-tc-server-standard --exclude=vfabric-tc-server-standard
这看上去与正常安装并没有什么不同。
我也尝试过:
# yum install pivotal-tc-server-standard --setopt=protected_packages=vfabric-tc-server-standard
---> Package pivotal-tc-server-standard.noarch 0:3.2.1-RELEASE will be obsoleting
---> Package vfabric-tc-server-standard.noarch 0:2.9.7-RELEASE will be obsoleted
Error: Trying to remove "vfabric-tc-server-standard", which is protected
答案1
我还没搞清楚如何使用 yum 来实现这一点。下面是可行的方法:
# yum -y install yum-utils
# yumdownloader pivotal-tc-server-standard
# rpm -i --replacefiles pivotal-tc-server-standard-X.X.X-RELEASE.noarch.rpm
# rpm -qa | grep tc-server
vfabric-tc-server-standard-2.9.7-RELEASE.noarch
pivotal-tc-server-standard-3.2.1-RELEASE.noarch