dnf broken after power loss
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/main.py", line 193, in user_main
errcode = main(args)
File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 64, in main
return _main(base, args, cli_class, option_parser_class)
File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 90, in _main
cli = cli_class(base)
File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 699, in __init__
self.register_command(dnf.cli.commands.alias.AliasCommand)
AttributeError: module 'dnf.cli.commands.alias' has no attribute 'AliasCommand'
Please use the code button when posting terminal output to make it easier to read. Are you able to run any other dnf commands?
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?