不同架构的 Yum 包冲突

不同架构的 Yum 包冲突

我有一台运行 CentOS 5.5 的机器,我想升级到最新的 5.x 版本。它遇到了 freetype 问题。

Freetype 安装了 i386 和 x86_64 版本。这是正常的,但 x86_64 版本要新得多(反向移植了 2.4 以支持其他几个软件包;我甚至没有 32 位机器来构建 i386 版本)。

[sh-beta@localhost ~]$ yum list installed | grep freetype
freetype.i386                       2.2.1-28.el5_7.2                   installed
freetype.x86_64                     2.4.8-1                            installed
[sh-beta@localhost ~]$ yum list updates | grep freetype
freetype.i386                     2.2.1-31.el5_8.1              updates         
[sh-beta@localhost ~]$ sudo yum -y update freetype.i386 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cicku.me
 * extras: mirrors.sonic.net
 * updates: centos.sonn.com
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package freetype.i386 0:2.2.1-31.el5_8.1 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================================
 Package                                   Arch                                  Version                                             Repository                                Size
====================================================================================================================================================================================
Updating:
 freetype                                  i386                                  2.2.1-31.el5_8.1                                    updates                                  312 k

Transaction Summary
====================================================================================================================================================================================
Install       0 Package(s)
Upgrade       1 Package(s)

Total size: 312 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test


Transaction Check Error:
  package freetype-2.4.8-1.x86_64 (which is newer than freetype-2.2.1-31.el5_8.1.i386) is already installed

Error Summary
-------------

[sh-beta@localhost ~]$

在这台测试机上,我可以手动将 x86_64 包降级到基础 CentOS 5.5 版本,然后再将两者都升级到 5.8 版本,没有任何问题。

[sh-beta@localhost ~]$ sudo yum -y downgrade freetype-2.2.1-28.el5_7.2.x86_64
<...snip...>
[sh-beta@localhost ~]$ yum list installed | grep freetype
freetype.i386                       2.2.1-28.el5_7.2                   installed
freetype.x86_64                     2.2.1-28.el5_7.2                   installed
[sh-beta@localhost ~]$ sudo yum update freetype-2.2.1-31.el5_8.1
<...snip...>
[sh-beta@localhost ~]$ yum list installed | grep freetype
freetype.i386                       2.2.1-31.el5_8.1                   installed
freetype.x86_64                     2.2.1-31.el5_8.1                   installed
[sh-beta@localhost ~]$

这是怎么回事?我该如何修复?由于我还有其他依赖 2.4 的软件包,因此降级是我服务器上的最后手段。

答案1

如果您不需要 i386 版本,freetype请将其删除:

  • rpm -e freetype.i386

如果您需要它,或者其他系统包依赖它,请执行以下操作:为 i386 重建它。如果您仍然拥有反向移植时生成的源 RPM,那么这非常简单。

  • 安装 EPEL 存储库
  • yum install mock
  • mock -r epel-5-i386 freetype-2.4.src.rpm

相关内容