使用 RHEL 5 上的 yum/rpm 可以yum upgrade
删除另一个有冲突的包吗?类似于apt-get dist-upgrade
Debian 上的行为?
我正在更新我们产品的 rpm 的 .spec。版本 4.2.x 使用了 mod_python,因此 spec 包含
Requires: mod_python
版本 4.3.x 在守护进程模式下使用 mod_wsgi,因此与同时加载 mod_python 不兼容(与 RHEL 5.x 中的软件包一样)。为了确保 mod_python 未在 4.3.x 版本中加载,我们尝试使用
Conflicts: mod_python
我希望这能让 yum 意识到它可以在升级时删除 mod_python,但它拒绝了,而且我找不到其他方法来配置/指示 yum
[root@server ~]# yum upgrade define
Loaded plugins: downloadonly, rhnplugin, security
Skipping security plugin, no data
Setting up Upgrade Process
Resolving Dependencies
Skipping security plugin, no data
--> Running transaction check
---> Package define.x86_64 0:4.3.14-1 set to be updated
--> Processing Dependency: shibboleth for package: define
--> Running transaction check
---> Package shibboleth.x86_64 0:2.4.3-2.2.el5 set to be updated
--> Processing Dependency: opensaml-schemas for package: shibboleth
--> Processing Dependency: xmltooling-schemas for package: shibboleth
--> Processing Dependency: libxmltooling-lite.so.5()(64bit) for package: shibboleth
--> Processing Dependency: libxerces-c-3.1.so()(64bit) for package: shibboleth
--> Processing Dependency: libsaml.so.7()(64bit) for package: shibboleth
--> Processing Dependency: liblog4shib.so.1()(64bit) for package: shibboleth
--> Processing Dependency: libodbc.so.1()(64bit) for package: shibboleth
--> Processing Dependency: libxml-security-c.so.16()(64bit) for package: shibboleth
--> Processing Dependency: libxmltooling.so.5()(64bit) for package: shibboleth
--> Running transaction check
---> Package libsaml7.x86_64 0:2.4.3-3.2.el5 set to be updated
---> Package libxerces-c-3_1.x86_64 0:3.1.1-2.2.el5 set to be updated
---> Package libxml-security-c16.x86_64 0:1.6.1-3.1.el5 set to be updated
---> Package libxmltooling5.x86_64 0:1.4.2-2.1.el5 set to be updated
---> Package log4shib.x86_64 0:1.0.3-2.1 set to be updated
---> Package opensaml-schemas.x86_64 0:2.4.3-3.2.el5 set to be updated
---> Package unixODBC-libs.x86_64 0:2.2.11-10.el5 set to be updated
---> Package xmltooling-schemas.x86_64 0:1.4.2-2.1.el5 set to be updated
--> Processing Conflict: define conflicts mod_python
--> Finished Dependency Resolution
define-4.3.14-1.x86_64 from define-development has depsolving problems
--> define conflicts with mod_python
Error: define conflicts with mod_python
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest
目前我正在使用
yum remove define; yum remove mod_python; yum install define
作为一种解决方法。有没有更好的方法可以用 yum/rpm 来处理这个问题(升级 foo 会触发 bar 的删除)?或者答案是“这是你不应该在 RHEL 上做的事情,所以不要这样做”?
答案1
我认为 yum 无法做到这一点;解决冲突的唯一方法是准备系统以避免冲突。插件可能会修改 yum 的行为并建议删除软件包来解决冲突,但我不知道有这种插件。