Lost dnf after migration from Centos7/8 and a lot of conflicts

I migrated my CentOS 7 to 8 and then to AlmaLinux, but in the process i lost dnf and yum. Now i try to fix, but have a lot of problems with dependencies etc. Only rpm is working so i have to do all “manually”.

If i try(the space in the urls was added intentionally)

rpm -ivh https:/ /vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/rpm-libs-4.14.3-19.el8.x86_64.rpm

i get an error:

Failed dependencies: rpm = 4.14.3-19.el8 is needed by rpm-libs-4.14.3-19.el8.x86_64

but if try:

rpm -ivh https:/ /repo.almalinux.org/almalinux/8/BaseOS/x86_64/os/Packages/rpm-4.14.3-19.el8_5.2.x86_64.rpm

i get a lot of conflicts https://pastebin.com/LexNqzY5

How can i fix it? I have only an remote access (via ssh or webmin) to this system.
I have an Centos 7 and AlmaLinux on VirtualBox, so i can possibly transfer some files from there.

How did you “migrate”?

https://linuxconfig.org/how-to-migrate-from-centos-to-almalinux but first i had to “migrate” to Centos 8.

There has never been a supported migration from CentOS Linux 7 into CentOS Linux 8.

However, AlmaLinux has released ELevate AlmaLinux OS - ELevate Your Distribution
The ELevate can convert some systems directly from CentOS Linux 7 into AlmaLinux 8 …
I can’t tell whether it could have worked on your system.

@jlehtone Unfortunately it will not help, because yum is not working - it needs dnf… i had AlmaLinux aready(Webmin recognizes it), but there are many packages from Centos 7 left.

Yes, ELevate does not help here. I did mention it just in case someone stumbles on this thread before they attempt migration.

TrevorH on CentOS Forum usually quips: “you broke it so you can keep the pieces”. That does not solve the issue either.

The ‘yum’ is just a symlink to ‘dnf’.

Limited access is annoying as it rules out fresh install? How was the system installed initially?

You OP failing command tried to update ‘rpm’. I would not touch rpm’s files if it works somehow. (Besides, looks like ‘rpm’ and ‘rpm-libs’ have to upgrade in same transaction.)

I’d rather try to install the dnf-package with rpm. What conflicts does that produce?

One can check what packages should be pulled in:

[Alma]# dnf rq --requires --resolve dnf
Last metadata expiration check: 0:33:19 ago on Thu 05 May 2022 10:16:11 AM EEST.
[Alma]# dnf rq --requires --resolve python3-dnf
Last metadata expiration check: 0:33:34 ago on Thu 05 May 2022 10:16:11 AM EEST.


The “full list” is rather long: dnf rq --requires --resolve --recursive dnf (and one can skip those ‘i686’ versions).