yum 依赖冲突已安装包

yum 依赖冲突已安装包

我想从 webtatic repo 安装 php 5.6:

yum 安装 php56w php56w-opcache php56w-mysql php56w-mcrypt php56w-pdo php56w-xml

其中一个依赖项是httpd:

Installing for dependencies:  httpd               x86_64     
2.2.15-31.el6.centos       updates       824 k

我已经安装了 apache 2.4。问题是 apache 的包名称是 httpd24-httpd

yum list installed | grep httpd
httpd24.x86_64       1-6.el6            @epel-httpd24                           
httpd24-apr.x86_64   1.4.8-2.el6        @epel-httpd24                           
httpd24-apr-util.x86_64
                     1.5.2-5.el6        @epel-httpd24                           
httpd24-httpd.x86_64 2.4.6-5.el6        @epel-httpd24                           
httpd24-httpd-tools.x86_64
                     2.4.6-5.el6        @epel-httpd24                           
httpd24-runtime.x86_64
                     1-6.el6            @epel-httpd24 

我如何告诉 yum 您正在寻找的软件包实际上是httpd24-httpd而不是httpd?问题是 httpd 作为依赖项无法安装,因为已经安装了 httpd 2.4:

Transaction Check Error:
  file /etc/httpd/conf.d/README from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/conf.d/welcome.conf from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/conf/httpd.conf from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/conf/magic from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/logs from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/modules from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/run from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64

任何解决方案都将不胜感激。我认为一种方法是重命名包;但是,我不熟悉这个过程(如果可能的话)。

答案1

CentOS 5 和 6 上的 Webtatic php56w 仅编译为支持基本 httpd 2.2 包。这是因为 mod_php 是针对基本发行版的 httpd 编译的。

我建议:

  • 使用 CentOS 7,其中 php56w 支持 httpd 2.4
  • 或者,在坚持使用 CentOS 6 的同时,使用 php56w-fpm 而不是 php56w,它的 fastcgi 接口由 httpd 2.4 的 mod_proxy_fcgi 支持

相关内容