Ask Your Question

How to fix a broken dnf

asked 2018-12-05 22:16:13 -0500

alfC gravatar image

Probably after an interruped dnf update, now I ended up with a broken dnf. Any command on dnf produces the following:

Traceback (most recent call last):
  File "/usr/bin/dnf", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.6/site-packages/dnf/", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.6/site-packages/dnf/", line 31, in <module>
    from dnf.module.repo_module_dict import RepoModuleDict
  File "/usr/lib/python3.6/site-packages/dnf/module/", line 22, in <module>
    import hawkey
  File "/usr/lib64/python3.6/site-packages/hawkey/", line 24, in <module>
    from . import _hawkey
ImportError: /lib64/ file too short

This can be a problem with dnf, the hawkey module or the zck library.

How can I fix this broken dnf?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-06 05:02:38 -0500

villykruse gravatar image

You will need a bootable liveCD, as the one you used to originally install your system.

In the liveCD open a shell prompt and run su to become root.

Then you lsblk -f to get the name of you root file system. Mount that file system on /mnt.

Then run the following:

dnf  --installroot=/mnt  reinstall dnf 'python3*' 'lib*'
dnf --installroot=/mnt  upgrade dnf 'python3*' 'lib*'

That should install or upgrade anything that is needed to run dnf.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2018-12-05 22:16:13 -0500

Seen: 302 times

Last updated: Dec 06 '18