CentOS:Yum 依赖问题

CentOS:Yum 依赖问题

我正在尝试在 CentOS 上安装 fail2ban,但我不明白为什么它无法安装:

[root@server ~]# yum install fail2ban
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.linux.duke.edu
 * epel: mirror.steadfast.net
 * extras: centosx5.centos.org
 * updates: centosc6.centos.org
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package fail2ban.noarch 0:0.8.4-29.el5 will be installed
--> Processing Dependency: shorewall for package: fail2ban-0.8.4-29.el5.noarch
--> Processing Dependency: python-inotify for package: fail2ban-0.8.4-29.el5.noarch
--> Processing Dependency: gamin-python for package: fail2ban-0.8.4-29.el5.noarch
--> Running transaction check
---> Package gamin-python.i686 0:0.1.10-9.el6 will be installed
---> Package python-inotify.noarch 0:0.9.1-1.el5 will be installed
--> Processing Dependency: python(abi) = 2.4 for package: python-inotify-0.9.1-1.el5.noarch
---> Package shorewall.noarch 0:4.0.15-1.el5 will be installed
--> Processing Dependency: shorewall-perl = 4.0.15-1.el5 for package: shorewall-4.0.15-1.el5.noarch
--> Processing Dependency: shorewall-shell = 4.0.15-1.el5 for package: shorewall-4.0.15-1.el5.noarch
--> Processing Dependency: shorewall-common = 4.0.15-1.el5 for package: shorewall-4.0.15-1.el5.noarch
--> Running transaction check
---> Package python-inotify.noarch 0:0.9.1-1.el5 will be installed
--> Processing Dependency: python(abi) = 2.4 for package: python-inotify-0.9.1-1.el5.noarch
---> Package shorewall-common.noarch 0:4.0.15-1.el5 will be installed
---> Package shorewall-perl.noarch 0:4.0.15-1.el5 will be installed
---> Package shorewall-shell.noarch 0:4.0.15-1.el5 will be installed
--> Finished Dependency Resolution
Error: Package: python-inotify-0.9.1-1.el5.noarch (epel)
           Requires: python(abi) = 2.4
           Installed: python-2.6.6-29.el6_3.3.i686 (@updates)
               python(abi) = 2.6
           Available: python-2.6.6-29.el6_2.2.i686 (base)
               python(abi) = 2.6
           Available: python26-2.6.8-2.el5.i386 (epel)
               python(abi) = 2.6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest
[root@server ~]# 

答案1

这可能是由于 CentOS 6 上来自过时(例如 el5)仓库的仓库和/或软件包之间存在冲突。请查看此主题获得关于从哪里开始进行故障排除的良好提示。

这对我有用,YMMV:

  1. 查找所有随 el5 安装的软件包并将其删除。你可以像这样找到它们:

    rpm -qa|grep el5
    
  2. 删除 el5 存储库

    yum repolist
    rpm -e <repo name>
    
  3. 安装正确的 EPEL 仓库。如果你和我一样使用的是 CentOS 6 32 位:

    rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
    
  4. 清理缓存yum(首先尝试一下 - 也许这就是全部):

    yum clean 
    

    或者

    yum clean expire-cache
    

相关内容