yum 声称 python 未安装

yum 声称 python 未安装

尝试安装 collectd,但由于某种原因,它声称未安装 python:

yum install collectd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package collectd.i386 0:4.10.0-4.el5 set to be updated
--> Processing Dependency: libxml2.so.2 for package: collectd
--> Processing Dependency: libcurl.so.3 for package: collectd
--> Processing Dependency: libpython2.4.so.1.0 for package: collectd
--> Processing Dependency: libidn.so.11 for package: collectd
---> Package collectd.x86_64 0:4.10.0-4.el5 set to be updated
--> Running transaction check
---> Package collectd.i386 0:4.10.0-4.el5 set to be updated
--> Processing Dependency: libpython2.4.so.1.0 for package: collectd
---> Package curl.i386 0:7.15.5-9.el5 set to be updated
---> Package libidn.i386 0:0.6.5-1.1 set to be updated
---> Package libxml2.i386 0:2.6.26-2.1.2.8 set to be updated
--> Finished Dependency Resolution
collectd-4.10.0-4.el5.i386 from epel has depsolving problems
  --> Missing Dependency: libpython2.4.so.1.0 is needed by package collectd-4.10.0-4.el5.i386 (epel)
Error: Missing Dependency: libpython2.4.so.1.0 is needed by package collectd-4.10.0-4.el5.i386 (epel)
 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
[root@vitlinpup001 templates]# find / -iname "libpython2.4.so.1.0" -type f
/usr/lib64/libpython2.4.so.1.0
[root@vitlinpup001 templates]# file /usr/lib64/libpython2.4.so.1.0
/usr/lib64/libpython2.4.so.1.0: ELF 64-bit LSB shared object, AMD x86-64, version 1 (SYSV), stripped
[root@vitlinpup001 templates]# ls -lah /usr/lib64/libpython2.4.so.1.0
-r-xr-xr-x 1 root root 1.2M Sep  3  2009 /usr/lib64/libpython2.4.so.1.0
[root@vitlinpup001 templates]# yum info python | grep installed
Repo       : installed

我试过逃跑package-cleanup --problemspackage-cleanup --dupes并且rpm -Va --nofiles --nodigest

这是我第一次遇到缺少依赖的情况,所以我有点不知道如何继续。

答案1

您误读了输出。它说缺少 Python 的 32 位库,这是正确的。请尝试安装collectd.x86_64

答案2

另一个解决方法是在 /etc/yum.conf 中添加以下行

排除=collectd.i386

答案3

这似乎是 EPEL 上的 collectd 的问题。x86_64 存储库似乎同时包含 64 位和 32 位软件包。这显然有问题。

如果您希望 yum install collectd “正常工作”,那么在 EPEL 修复之前,将 exclude=collectd.i386 添加到 /etc/yum.conf(如 kisoku 所述)可能是最好的解决方案

答案4

如果有多个可用软件包,您可以告诉 Yum 优先选择与机器体系结构匹配的软件包。在 中设置以下内容yum.conf

multilib_policy=best

这将取代以前的yum-basearchonly插件作为核心功能。这是 Fedora 9 和 RHEL 6 及更高版本中的默认行为。

相关内容