Centos

使用 yum 更新 clamav 時如何解決此依賴錯誤?

  • August 28, 2018

我正在嘗試更新clamav舊的 CentOS 5 郵件伺服器安裝,但不斷收到我無法理解的依賴錯誤。

我按照這裡描述的方法。

也許有人可以告訴我如何通過這個?

[root@s1 ~]# yum list clamav
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.mirror.facebook.net
* extras: centos-distro.cavecreek.net
* rpmforge: mirror.hmc.edu
* updates: mirror.thelinuxfix.com
base                                                                                                                                                                                                      | 1.1 kB     00:00     
dag                                                                                                                                                                                                       | 1.9 kB     00:00     
extras                                                                                                                                                                                                    | 2.1 kB     00:00     
rpmforge                                                                                                                                                                                                  | 1.9 kB     00:00     
updates                                                                                                                                                                                                   | 1.9 kB     00:00     
Excluding Packages in global exclude list
Finished
Installed Packages
clamav.i386                                                                                               0.97.6-1.el5.rf                                                                                               installed
clamav.i386                                                                                               0.97.7-1.el5.rf                                                                                               installed
[root@s1 ~]# 



[root@s1 ~]# yum update clamav
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* base: centos.mirror.facebook.net
* extras: centos-distro.cavecreek.net
* rpmforge: mirror.hmc.edu
* updates: mirror.thelinuxfix.com
base                                                                                                                                                                                                      | 1.1 kB     00:00     
dag                                                                                                                                                                                                       | 1.9 kB     00:00     
extras                                                                                                                                                                                                    | 2.1 kB     00:00     
rpmforge                                                                                                                                                                                                  | 1.9 kB     00:00     
updates                                                                                                                                                                                                   | 1.9 kB     00:00     
Excluding Packages in global exclude list
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
--> Processing Dependency: clamav = 0.97.6-1.el5.rf for package: clamd
---> Package clamav.i386 0:0.97.7-1.el5.rf set to be updated
--> Finished Dependency Resolution
clamd-0.97.6-1.el5.rf.i386 from installed has depsolving problems
 --> Missing Dependency: clamav = 0.97.6-1.el5.rf is needed by package clamd-0.97.6-1.el5.rf.i386 (installed)
Error: Missing Dependency: clamav = 0.97.6-1.el5.rf is needed by package clamd-0.97.6-1.el5.rf.i386 (installed)
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@s1 ~]# 

執行建議後得到以上結果:

package-cleanup --problems
package-cleanup --dupes
rpm -Va --nofiles --nodigest

yum --disablerepo=\* --enablerepo=rpmforge update clam\*我按照一個答案跑了,收到如下終端輸出:

[root@s1 ~]# yum --disablerepo=\* --enablerepo=rpmforge update clam\*
Loaded plugins: fastestmirror, priorities
Loading mirror speeds from cached hostfile
* rpmforge: mirror.hmc.edu
rpmforge                                                                                | 1.9 kB     00:00     
Excluding Packages in global exclude list
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package clamav.i386 0:0.97.7-1.el5.rf set to be updated
---> Package clamav-db.i386 0:0.97.7-1.el5.rf set to be updated
---> Package clamd.i386 0:0.97.7-1.el5.rf set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

===============================================================================================================
Package                   Arch                 Version                         Repository                Size
===============================================================================================================
Updating:
clamav                    i386                 0.97.7-1.el5.rf                 rpmforge                 2.2 M
clamav-db                 i386                 0.97.7-1.el5.rf                 rpmforge                  34 M
clamd                     i386                 0.97.7-1.el5.rf                 rpmforge                 243 k

Transaction Summary
===============================================================================================================
Install       0 Package(s)
Upgrade       3 Package(s)

Total download size: 37 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): clamd-0.97.7-1.el5.rf.i386.rpm                                                   | 243 kB     00:00     
(2/3): clamav-0.97.7-1.el5.rf.i386.rpm                                                  | 2.2 MB     00:00     
(3/3): clamav-db-0.97.7-1.el5.rf.i386.rpm                                               |  34 MB     00:03     
---------------------------------------------------------------------------------------------------------------
Total                                                                          9.0 MB/s |  37 MB     00:04     
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test


Transaction Check Error:
 package clamav-db-0.97.7-1.el5.rf.i386 is already installed
 package clamd-0.97.7-1.el5.rf.i386 is already installed
 package clamav-0.97.7-1.el5.rf.i386 is already installed

Error Summary
-------------

[root@s1 ~]# 

安裝的包,根據yum list clam\*是:

clamav.i386                                         0.97.6-1.el5.rf                                   installed
clamav.i386                                         0.97.7-1.el5.rf                                   installed
clamav-db.i386                                      0.97.6-1.el5.rf                                   installed
clamav-db.i386                                      0.97.7-1.el5.rf                                   installed
clamd.i386                                          0.97.6-1.el5.rf                                   installed
clamd.i386                                          0.97.7-1.el5.rf                                   installed
Available Packages
clamav-devel.i386                                   0.97.7-1.el5.rf                                   dag      
clamav-milter.i386                                  0.97.7-1.el5.rf                                   dag      
clamtk.i386                                         3.09-1.el5.rf                                     dag      
clamtk.noarch                                       4.25-1.el5.rf                                     dag

為什麼我仍然0.97.6-1.el5.rf在列表中看到?

我的第一個猜測是您正在混合 YUM 儲存庫。請注意,clamav 的 RPM.rf.在其名稱中表示它是一個 rpmforge 包。我會確認 clamd 也是一個 rpmforge 包,而不是來自其他儲存庫之一。

報錯資訊基本上就是在告訴你這個,說找不到合適的包,clamd...rf....

只關注 rpmforge 儲存庫

您可以暫時禁用每個 repo 並只啟用 rpmforge repo,如下所示:

$ yum --disablerepo=\* --enablerepo=rpmforge update clam\*

上述命令將允許 yum 僅針對一個 repo (rpmforge) 進行更新。

重複的 RPM

如果您遇到clam*像 OP 一樣安裝的 RPMS 的重複版本,則可以使用以下命令來辨識情況:

$ yum list clam\*
clamav.i386                                         0.97.6-1.el5.rf                                   installed
clamav.i386                                         0.97.7-1.el5.rf                                   installed
clamav-db.i386                                      0.97.6-1.el5.rf                                   installed
clamav-db.i386                                      0.97.7-1.el5.rf                                   installed
clamd.i386                                          0.97.6-1.el5.rf                                   installed
clamd.i386                                          0.97.7-1.el5.rf  
...
...

此命令將通過刪除重複的包來解決該問題:

$ yum --disablerepo=\* --enablerepo=rpmforge remove clam\*-0.97.6-1.el5.rf

參考

引用自:https://unix.stackexchange.com/questions/78978