Ask Your Question

dnf broken after power loss

asked 2019-03-01 13:58:54 -0500

matthew.hudson gravatar image

updated 2019-03-01 15:07:43 -0500

after dnf update and power loss i get this.

[root@localhost Downloads]# dnf update
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/", line 193, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/", line 64, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/", line 90, in _main
    cli = cli_class(base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/", line 699, in __init__
AttributeError: module 'dnf.cli.commands.alias' has no attribute 'AliasCommand'
edit retag flag offensive close merge delete


Please use the code button when posting terminal output to make it easier to read. Are you able to run any other dnf commands?

bob323 gravatar imagebob323 ( 2019-03-01 14:50:34 -0500 )edit

Assuming that the problem is only related to dnf you can grab the package(s) from the noarch section from here. Then install them with sudo rpm -Uvh *.rpm --force. This should restore your local dnf installation. Beware there could be other reasons why dnf got broken. Do you have another instance of Python that takes priority over the default one?

vmercuri gravatar imagevmercuri ( 2019-03-01 18:24:26 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-03-05 02:47:23 -0500

Toover gravatar image

You may reinstall dnf manually, by downloading it from a mirror, and then running rpm -i ${DOWNLOADED_RPM}.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-03-01 13:58:54 -0500

Seen: 107 times

Last updated: Mar 01 '19