12

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

5 Answers 5

8

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.

2
  • 7
    dnf remove : Error: Problem: The operation would result in removing the following protected packages: dnf
    – Exlord
    Jan 18, 2020 at 5:21
  • 3
    swap : Error: Problem: package python-libs-2.7.5-86.el7.x86_64 requires libgdbm.so.4()(64bit), but none of the providers can be installed - conflicting requests - problem with installed package python-libs-2.7.5-86.el7.x86_64
    – Exlord
    Jan 18, 2020 at 5:21
4

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.

1
  • 1
    That indeed was the way that worked for me.
    – Arkhitech
    Jan 31, 2021 at 21:59
1

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.

0

I had the same issue and the answer given by sgros was almost correct in our case, but I had to remove sysvinit and sysvinit-tools also.

0

Today upgraded Centos 7 to 8 sucesfully, and then from 8 to Rocky Linux 8, thanks for some advices.

Used this guide - https://techviewleo.com/how-to-migrate-from-centos-7-to-rocky-linux-8/

On this step was many conflicting packages:

sudo dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

So first of all i deleted:

dnf remove NetworkManager
dnf remove dracut-network.x86_64
dnf remove python36-rpmconf

also i did this:

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

then command for upgrade started to work but without Appstream repo (1559/1559 steps completed):

dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync --disablerepo=appstream

then this started to work (869/869 steps):

dnf -y --releasever=8 --allowerasing --setopt=deltarpm=false distro-sync

last thing before restart:

dnf -y groupupdate "Core" "Minimal Install"

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .