Centos8 dnf 更新事务检查错误

Exl*_*ord 6 centos dnf centos-8

dnf update 在将我的 centos7 升级到 centos8 后给我这个错误

Error: Transaction check error:
  file /usr/lib64/libgdbm_compat.so.4.0.0 from install of gdbm-libs-1:1.18-1.el8.x86_64 conflicts with file from package gdbm-1.10-8.el7.x86_64
Run Code Online (Sandbox Code Playgroud)

我试过了dnf install -y libgdbm --best --allowerasingdnf install -y gdbm --best --allowerasingdnf update仍然有这个错误。

我怎样才能解决这个问题?

更新 :

dnf upgrade --best --allowerasing 结果如下:

Error: transaction check vs depsolve:
(gcc >= 8 with gcc < 9) is needed by annobin-8.78-1.el8.x86_64
rpmlib(RichDependencies) <= 4.12.0-1 is needed by annobin-8.78-1.el8.x86_64
(annobin if gcc) is needed by redhat-rpm-config-120-1.el8.noarch
rpmlib(RichDependencies) <= 4.12.0-1 is needed by redhat-rpm-config-120-1.el8.noarch
To diagnose the problem, try running: 'rpm -Va --nofiles --nodigest'.
You probably have corrupted RPMDB, running 'rpm --rebuilddb' might fix the issue.
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.

Run Code Online (Sandbox Code Playgroud)

https://forums.centos.org/viewtopic.php?f=54&t=73160

Chr*_*aes 5

似乎gdbm已经改变了它的包装方式。

旧版本gdbm-1.10-8.el7.x86_64提供与新版本相同的文件gdbm-libs-1:1.18-1.el8.x86_64,因此您可以做的最好的事情可能是gdbm-1.10-8.el7.x86_64在重试更新之前手动擦除:

dnf remove gdbm-1.10-8.el7.x86_64
Run Code Online (Sandbox Code Playgroud)

如果这不起作用,因为有人需要,/usr/lib64/libgdbm_compat.so.4.0.0那么您可以使用更复杂的swap命令:

dnf swap gdbm-1.10-8.el7.x86_64 gdbm-libs-1:1.18-1.el8.x86_64
Run Code Online (Sandbox Code Playgroud)

编辑

好像我们需要说服dnf来改变gdbmgdbmgdbm-libs。尝试:

dnf install gdbm gdbm-libs --best --allowerasing
Run Code Online (Sandbox Code Playgroud)

注意:我尝试了 centos7 - centos8 升级程序并遇到了多个问题。在此迁移工作之前,我必须删除相当多的软件包。当文件从包中更改时,当它们被重命名等时,这就是麻烦。我怀疑现在我让这部分工作了,其余的应该很好。祝你好运。

  • dnf remove : `错误:问题:该操作将导致删除以下受保护的包:dnf` (4认同)
  • 交换:`错误:问题:包 python-libs-2.7.5-86.el7.x86_64 需要 libgdbm.so.4()(64 位),但无法安装任何提供程序 - 请求冲突 - 安装包 python 有问题-libs-2.7.5-86.el7.x86_64 ` (2认同)