Ask Your Question
0

How to fix a broken dnf

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

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/__init__.py", line 31, in <module>
    import dnf.base
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 31, in <module>
    from dnf.module.repo_module_dict import RepoModuleDict
  File "/usr/lib/python3.6/site-packages/dnf/module/repo_module_dict.py", line 22, in <module>
    import hawkey
  File "/usr/lib64/python3.6/site-packages/hawkey/__init__.py", line 24, in <module>
    from . import _hawkey
ImportError: /lib64/libzck.so.1: 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
0

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

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

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

Seen: 168 times

Last updated: Dec 06 '18