CentOS 5:安装 php-imap 时出错

CentOS 5:安装 php-imap 时出错

有人可以帮我解决这个 CentOS 5 问题吗?

我正在尝试安装 php-imap,我试过了

yum install php-imap

但我得到了以下输出:

Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
 * base: centos.hostingxtreme.com
 * epel: mirror.steadfast.net
 * extras: mirror.team-cymru.org
 * updates: mirror.beyondhosting.net
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-imap.x86_64 0:5.1.6-44.el5_10 set to be updated
--> Processing Dependency: php-common = 5.1.6-44.el5_10 for package: php-imap
--> Finished Dependency Resolution
php-imap-5.1.6-44.el5_10.x86_64 from updates has depsolving problems
  --> Missing Dependency: php-common = 5.1.6-44.el5_10 is needed by package php-imap-5.1.6-44.el5_10.x86_64 (updates)
Error: Missing Dependency: php-common = 5.1.6-44.el5_10 is needed by package php-imap-5.1.6-44.el5_10.x86_64 (updates)
 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
The program package-cleanup is found in the yum-utils package.

我已经安装了 php-common,我运行“yum install php-common”并得到以下输出

Loaded plugins: fastestmirror, priorities, security
Loading mirror speeds from cached hostfile
 * base: centos.hostingxtreme.com
 * epel: mirror.steadfast.net
 * extras: mirror.team-cymru.org
 * updates: mirror.beyondhosting.net
Setting up Install Process
Package matching php-common-5.1.6-44.el5_10.x86_64 already installed. Checking for update.
Nothing to do

我该如何解决这个问题?

答案1

我怀疑 RPM 数据库或 yum 缓存中的某个部分已损坏。我会将它们全部清除并重建。

首先是 RPM 数据库:

rm -f /var/lib/rpm/__db.*
rpm --rebuilddb   # In later versions, this command changed to  rpmdb --rebuilddb

然后是 yum 缓存:

yum clean all

然后使所有内容与远程存储库上的最新内容同步:

yum distro-sync

最后,尝试再次安装该包。

答案2

在这种情况下,我宁愿完全删除 php-common,然后尝试安装 php-imap。

yum remove php-common*
yum install php-imap

相关内容