Centos8 dnf update transaction check error

dnf update giving me this error, after upgrading my centos7 to 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

I tried dnf install -y libgdbm --best --allowerasing and dnf install -y gdbm --best --allowerasing but dnf update still has this error.

How can I fix this?

UPDATE :

dnf upgrade --best --allowerasing results this :

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'.

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


it seems like gdbm has changed its way of packaging.

The old version gdbm-1.10-8.el7.x86_64 provides the same file as the new gdbm-libs-1:1.18-1.el8.x86_64, so the best you can do probably is erase manually gdbm-1.10-8.el7.x86_64 before retrying the update:

dnf remove gdbm-1.10-8.el7.x86_64

If this does not work because someone needs /usr/lib64/libgdbm_compat.so.4.0.0 then you can use the more complicated swap command:

dnf swap gdbm-1.10-8.el7.x86_64 gdbm-libs-1:1.18-1.el8.x86_64

edit

It seems like we need to convince dnf to change gdbm into gdbm AND gdbm-libs. Try with:

dnf install gdbm gdbm-libs --best --allowerasing

NOTE: I tried the centos7 - centos8 upgrade procedure and ran into multiple problems. I had to remove quite a few packages before this migration would work. That is the trouble when files change from packages, when they are renamed etc. I suspect that now that I got this part working the rest should follow quite fine. Good luck.


I managed to get past this by manually updating gdbm and gdbm-libs using rpm (and ignoring dependencies).

sudo rpm -e --nodeps gdbm-1.10-8.el7.x86_64
sudo rpm -i /var/cache/dnf/baseos-929b586ef1f72f69/packages/gdbm-libs-1.18-1.el8.x86_64.rpm

You may need to download the missing package manually if dnf didn't take them into set of packages to be upgraded. In addition I had to remove python3-pip-9.0.3 and python36-rpmconf, again, with rpm and ignoring dependencies. Then I started distro-sync.

In essence, what I've did is that I removed offending packages that were reported by dnf, and started dnf again. But be careful that you don't remove something that is critical to rpm and dnf, otherwise, you won't be able to upgrade the system.


Swap did not work for us on one server. The other when through 7.7 --> 8.0 --> 8.1 without a glitch, aside from some minor packages and GPG-key issues.

If stuck in 8.X and can not upgrade or install anything simply reinstall centos-relase 7 directly from the rpm. http://mirror.centos.org/centos/7/os/x86_64/Packages/centos-release-7-7.1908.0.el7.centos.x86_64.rpm

It will allow you to continue with gdbm-1.