Ask Your Question

How do I fix a broken dnf Fedora28

asked 2018-08-05 12:59:51 -0600

dbsnyder40 gravatar image

updated 2018-08-06 06:51:34 -0600

After playing with conda and possibly reconfiguring python3, I find that dnf no longer works.

$ dnf
Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
ModuleNotFoundError: No module named 'dnf'

I have tried using yum and rpm to reinstall dnf. They seem to point back to dnf. I have tried using the gnome software package to delete and install dnfdragora. I see no reference to dnf or dnf-core.

Have I exhausted the easy options?

My next step is to try rebuilding dnf from the github source but the first step

sudo dnf builddep dnf.spec

doesn't look promising, but I will try it anyway. Maybe I can reroute the installation from a LiveCD?

edit retag flag offensive close merge delete


I made some progress but no luck yet, from


I found I can reach the repositories at

and I was able to find and download the four rpm packages


and I am able to run rpm (unlike what I said above)

sudo rpm --reinstall dnf*


dbsnyder40 gravatar imagedbsnyder40 ( 2018-08-05 14:17:05 -0600 )edit

and I am able to run rpm (unlike what I said above)

sudo rpm --reinstall dnf*

but I got warnings like /sbin/ldconfig: libraries and in directory /lib have same soname but different type.

(I may not be completely upto date.)

but running dnf still gives the error:

No module named 'dnf'

I'm beginning to think I have to reinstall Fedora.

dbsnyder40 gravatar imagedbsnyder40 ( 2018-08-05 14:17:41 -0600 )edit

as stated above I reinstalled dnf. I downloaded the python3 rpm, and a few of the python3-dnf rpms. but before I could install them with rpm, I ran into other problems. I think Gnome went unstable. I could not enter a password to unfreeze the screen. It looked like only one character was processed at a time. Then, after using power button to shut down, the system stopped booting - so I did a reinstall anyway

I think I will create a dedicated conda user and not install anaconda with sudo. Conda and dnf do not play well together.

dbsnyder40 gravatar imagedbsnyder40 ( 2018-08-06 06:51:06 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-08-06 10:38:25 -0600

awfed gravatar image

Have a look at this

To avoid this there will be atomic updates

Me too had a broken Fedora 28 due to iresponsive update but I reinstalled completely. The chance to have an inconsistent system is too big.

Good luck.

edit flag offensive delete link more


The link is broken. New link seems to be

alfC gravatar imagealfC ( 2018-12-02 22:42:19 -0600 )edit

Question Tools

1 follower


Asked: 2018-08-05 12:59:51 -0600

Seen: 1,985 times

Last updated: Aug 06 '18