Hi.

On Thu, 14 Nov 2024 16:15:47 -0500 Jeffrey Walton wrote:
> Trying to run dnf results in similar to [1]:

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

> I'm trying to repair dnf using rpm.[2] I *think* `rpm --reinstall
> python3-dnf*.rpm` may be able to repair dnf. But I'm not sure about
> dnf vs dnf5:

>    # from a working F41 machine
>    $ dnf search '*dnf*'
>    ...
>    python3-libdnf.x86_64: Python 3 bindings for the libdnf library.
>    python3-libdnf5.x86_64: Python 3 bindings for the libdnf library

> So my question is, is the generic 'dnf' Ok,

I think so.

> or should I try to install specific 'dnf5' for Fedora 41?

Probably not mandatory.

> Or maybe something else?

/usr/bin/dnf (F40) is a /usr/bin/python3 script.

I suspect that python3.13 (Fedora 41) has been installed, giving the
symlink:

  /usr/bin/python3 -> python3.13

but that dnf5 and the python3-libdnf* RPMs have not be installed
(before the failure of system-upgrade).

python3.12 and all its modules is probably still there.

If python3.12 and all its modules is still there, you may try to:

  - replace temporarily the /usr/bin/python3 symlink to point to
    python3.12
  - run "dnf distro-sync" to repair

Note: there is probably duplicates RPMs. dnf4 provides (not dnf5
AFAIK):

  dnf remove --duplicates

that may help before distro-sync

> [1] https://www.reddit.com/r/Fedora/comments/12blsg0/my_dnf_is_broken/
> [2] 
> https://www.reddit.com/r/Fedora/comments/12blsg0/comment/jf3qonz/?context=3
> [3] https://www.youtube.com/watch?v=P1tihTYb1wk&t=20s

-- 
francis
-- 
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to