Linux

RHEL 伺服器 Yum 依賴項不起作用

  • April 11, 2012

我有一個無法正確解析依賴關係的 redhat 伺服器。

我想通過 yum “yum install httpd” 安裝 httpd 並且它安裝正確,但是當我去啟動 httpd 時出現以下錯誤:

/sbin/service httpd 重啟

Stopping httpd:                                            [FAILED]
Starting httpd: /usr/sbin/httpd: error while loading shared libraries: libaprutil-1.so.0: cannot open shared object file: No such file or directory
                                                          [FAILED]

它缺少 apr-util 包的依賴項。

奇怪的是安裝了 i386 包而不是 x86_64 包。任何人都可以解釋為什麼可能無法正確解決依賴關係嗎?

ldd /usr/sbin/httpd
   libm.so.6 => /lib64/libm.so.6 (0x00002b02370db000)
   libpcre.so.0 => /lib64/libpcre.so.0 (0x00002b023735e000)
   libselinux.so.1 => /lib64/libselinux.so.1 (0x00002b023757a000)
   libaprutil-1.so.0 => not found
   libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b0237793000)
   libldap-2.3.so.0 => /usr/lib64/libldap-2.3.so.0 (0x00002b02379cb000)
   liblber-2.3.so.0 => /usr/lib64/liblber-2.3.so.0 (0x00002b0237c06000)
   libdb-4.3.so => /lib64/libdb-4.3.so (0x00002b0237e14000)
   libexpat.so.0 => /lib64/libexpat.so.0 (0x00002b0238109000)
   libapr-1.so.0 => not found
   libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b023832c000)
   libdl.so.2 => /lib64/libdl.so.2 (0x00002b0238547000)
   libc.so.6 => /lib64/libc.so.6 (0x00002b023874c000)
   libsepol.so.1 => /lib64/libsepol.so.1 (0x00002b0238aa3000)
   /lib64/ld-linux-x86-64.so.2 (0x00002b0236ebe000)
   libresolv.so.2 => /lib64/libresolv.so.2 (0x00002b0238ce9000)
   libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00002b0238eff000)
   libssl.so.6 => /lib64/libssl.so.6 (0x00002b0239118000)
   libcrypto.so.6 => /lib64/libcrypto.so.6 (0x00002b0239364000)
   libgssapi_krb5.so.2 => /usr/lib64/libgssapi_krb5.so.2 (0x00002b02396b6000)
   libkrb5.so.3 => /usr/lib64/libkrb5.so.3 (0x00002b02398e4000)
   libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00002b0239b79000)
   libk5crypto.so.3 => /usr/lib64/libk5crypto.so.3 (0x00002b0239d7c000)
   libz.so.1 => /usr/lib64/libz.so.1 (0x00002b0239fa1000)
   libkrb5support.so.0 => /usr/lib64/libkrb5support.so.0 (0x00002b023a1b5000)
   libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00002b023a3be000)

然而這是 i386 包

apr-util-1.2.7-11.el5.i386 : Apache Portable Runtime Utility library
Repo        : installed
Matched from:
Filename    : /usr/lib/libaprutil-1.so.0

更新:只是為了更新,我也在 cobbler 伺服器上託管我自己的 repo,但它是正確創建的,我不確定這是否會導致 dep 解決問題?

UPDATE2:我已將調試級別更改為 10 以查看我通過 yum 得到的結果,這是輸出。

我很確定應該有一個條目而不是沒有,但不確定它應該是什麼……

Resolving Dependencies
Running "preresolve" handler for "security" plugin
--> Running transaction check
---> Package httpd.x86_64 0:2.2.3-31.el5 set to be updated
Checking deps for httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('initscripts', 'GE', ('0', '8.36', None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libc.so.6(GLIBC_2.2.5)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libpthread.so.0(GLIBC_2.2.5)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('rtld(GNU_HASH)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/etc/mime.types', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/bin/bash', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/bin/sh', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('textutils', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libm.so.6(GLIBC_2.2.5)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/sbin/chkconfig', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/bin/rm', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/bin/sh', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/bin/mv', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/usr/share/magic.mime', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/usr/sbin/useradd', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/usr/bin/find', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libcrypt.so.1(GLIBC_2.2.5)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('sh-utils', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libc.so.6(GLIBC_2.3.4)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libc.so.6(GLIBC_2.4)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('gawk', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libc.so.6(GLIBC_2.3)(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('/bin/mktemp', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libc.so.6()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libpcre.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libdb-4.3.so()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libcrypto.so.6()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libexpat.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libselinux.so.1()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libm.so.6()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libssl.so.6()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('liblber-2.3.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libdl.so.2()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libaprutil-1.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libz.so.1()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libcrypt.so.1()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libapr-1.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libpthread.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
looking for ('libldap-2.3.so.0()(64bit)', None, (None, None, None)) as a requirement of httpd.x86_64 0-2.2.3-31.el5 - u
--> Finished Dependency Resolution
Dependency Process ending
Depsolve time: 0.811

我已經將此問題追溯到另一​​個包廣告,它可以解決 libapr 的依賴關係。所以當http說它需要libapr時,這個寫得很糟糕的包說它可以滿足庫的需要,所以安裝了而不是正確的redhat libapr包。我組織了開發者被打

我不確定為什麼您不會獲得正確的依賴項(不知道確切的 RHEL 版本,很難仔細檢查資訊)。在多種情況下,您可能需要或同時安裝同一軟體包的 i386 和 x86_64 版本。也有可能遇到怪癖或錯誤(儘管我很少看到它),其中特定於體系結構的包會破壞依賴關係。

您應該能夠使用yum install apr-util-1.2.7-11.el5.x86_64.

引用自:https://serverfault.com/questions/374027