Linux

centos 7 - yum 更新失敗

  • November 15, 2017

我無法安裝控制面板,因為 yum 更新失敗。我用centos7。請幫幫我…. 我該怎麼辦?

[root@trial ~]# yum 
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.nes.co.id
* centosplus: mirror.nes.co.id
* epel: epel.mirror.angkasa.id
* extras: mirror.axarva.id
* updates: mirror.nes.co.id
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand (maybe package-cleanup can help).
The program yum-complete-transaction is found in the yum-utils package.
--> Running transaction check
---> Package nettle.x86_64 0:2.7.1-8.el7 will be updated
--> Processing Dependency: libhogweed.so.2()(64bit) for package: gnutls-3.3.26-9.el7.x86_64
--> Processing Dependency: libnettle.so.4()(64bit) for package: gnutls-3.3.26-9.el7.x86_64
---> Package nettle.x86_64 0:3.2-2.el6 will be an update
--> Processing Dependency: libgmp.so.3()(64bit) for package: nettle-3.2-2.el6.x86_64
--> Finished Dependency Resolution
Error: Package: gnutls-3.3.26-9.el7.x86_64 (@base)
          Requires: libhogweed.so.2()(64bit)
          Removing: nettle-2.7.1-8.el7.x86_64 (@base)
              libhogweed.so.2()(64bit)
          Updated By: nettle-3.2-2.el6.x86_64 (epel)
             ~libhogweed.so.4()(64bit)
Error: Package: nettle-3.2-2.el6.x86_64 (epel)
          Requires: libgmp.so.3()(64bit)
Error: Package: gnutls-3.3.26-9.el7.x86_64 (@base)
          Requires: libnettle.so.4()(64bit)
          Removing: nettle-2.7.1-8.el7.x86_64 (@base)
              libnettle.so.4()(64bit)
          Updated By: nettle-3.2-2.el6.x86_64 (epel)
             ~libnettle.so.6()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
[root@trial ~]#

如果您檢查錯誤消息,您會看到更新包包含el6.x86_64前綴,即 CentOS 6 的 rpm 包。看起來您為 CentOS 6 安裝了 EPEL。刪除錯誤的 repo(例如,rpm -qa | grep epel | xargs rpm -e或者rm /etc/yum.repos.d/epel*.repo如果您手動安裝) ,執行yum clean all,安裝正確的EPEL槽yum install epel-release並再次嘗試執行yum update

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