At some point over the past years, dnf stopped working for me. I don’t recall the details at this point; only that when I attempt to use dnf I see the following error.
$ dnf
Traceback (most recent call last):
File “/usr/bin/dnf”, line 57, in
from dnf.cli import main
File “/usr/local/lib/python3.9/site-packages/dnf/init.py”, line 30, in
import dnf.base
File “/usr/local/lib/python3.9/site-packages/dnf/base.py”, line 29, in
import libdnf.transaction
ModuleNotFoundError: No module named ‘libdnf’
My current release is Fedora 4.20.13-200.fc29.x86_64 and I’d like to upgrade to the fc33, but would like to update other stuff as well and will need a working dnf to do so. How can I restore dnf so that it works correctly?
$ yum whatprovides libdnf
Traceback (most recent call last):
File “/usr/bin/yum”, line 57, in
from dnf.cli import main
File “/usr/local/lib/python3.9/site-packages/dnf/init.py”, line 30, in
import dnf.base
File “/usr/local/lib/python3.9/site-packages/dnf/base.py”, line 29, in
import libdnf.transaction
ModuleNotFoundError: No module named ‘libdnf’
[riwarren@rawlinux python3.9]$
is concerning. Did you try to build or install DNF not as a package at some point, or did you install a different version of python via some method other than rpm?
I did install a version of python from python.org…
I’ve also been attempting to restore the dnf functionality over time, so it is possible I’ve made things worse.