Dnf, cups fail after difficult update f38 Xfce

A few days ago I started a routine dnf update. Didn’t work from terminal, several tries. Then woke up dnfdragora-update, and managed to complete the task by selecting blocks of items to update. The recurring error in terminal and also in dnfdragora had seemed to blame the repository, or also perhaps memory? I see many people have had issues with memory. Have 8 Gb, HP EliteBook 2740p.
Anyway, the next time I tried to print after the update, no printers. cups in terminal responds “command not found.”
When I try to run dnf I get

Traceback (most recent call last):
  File "/usr/bin/dnf", line 61, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.11/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.11/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.11/site-packages/libdnf/__init__.py", line 14, in <module>
    from . import conf
  File "/usr/lib64/python3.11/site-packages/libdnf/conf.py", line 10, in <module>
    from . import _conf
ImportError: /lib64/librepo.so.0: invalid ELF header

Trying to download microdnf, as advised in other threads to people who lost dnf, I’m afraid I’m too dumb to figure out where to find the rpm, the github has many options but I don’t see this obvious one.

So, stuck. It would be time to do an upgrade, anyway, perhaps…

Did two separate full backups. If no resolution I will install f40 from a blank slate, I hope this time I remember to reserve a swap partition, I tend to forget that. Sucks to have to reinstall the bells and whistles and hope that I saved the passwords in Firefox, the usual… Thank you!

microdnf for f38 is here: https://koji.fedoraproject.org/koji/buildinfo?buildID=2267564

installed it successfully with

 sudo rpm -ivh microdnf-3.10.0-2.fc38.x86_64.rpm`

however,

sudo microdnf

fails to run because
error while loading shared libraries: /lib64/librepo.so.0: invalid ELF header .
Chasing that now…

got librepo here: https://kojipkgs.fedoraproject.org//packages/librepo/1.17.1/1.fc38/x86_64/librepo-1.17.1-1.fc38.x86_64.rpm
tried to install it, was told it was already installed, thus i reinstalled with

sudo rpm --reinstall librepo-1.17.1-1.fc38.x86_64.rpm

seemed to work. tested again

sudo microdnf

no errors this time

now,

sudo microdnf install cups

lots of coughs and splutters, then it says “nothing to do”. trying to run cups gets me bash: cups: command not found

I guess that’s the end of the line. will have to do a fresh install, sigh.

I hope you understand that f38 is (or will be later this month) EOL.

I suggest that you first try upgrading to f39 or f40 before you go further down that rabbit hole.

Many things have changed and bugs fixed in the last year.

If you have a LiveUSB, You can fix your broken dnf and update the system to a newer release using the LiveUSB’s dnf --installroot= options.


Here is a link to a forum thread, where in the second half of the post, I help the user reinstall dnf