Power outage after DNF update and now can't run any DNF command (Python error about filesystem encoding)

Hello! Update was broke due to lights off. :joy:
After reboot when I trying to run any dnf command (not even update any remove or install also) I get an error

[furer@localhost ~]$ sudo dnf update

  • [sudo] password for furer: *
    Python path configuration:
  • PYTHONHOME = (not set)*
  • PYTHONPATH = (not set)*
  • program name = ‘/usr/bin/python3’*
  • isolated = 0*
  • environment = 1*
  • user site = 1*
  • import site = 1*
  • sys._base_executable = ‘/usr/bin/python3’*
  • sys.base_prefix = ‘/usr’*
  • sys.base_exec_prefix = ‘/usr’*
  • sys.executable = ‘/usr/bin/python3’*
  • sys.prefix = ‘/usr’*
  • sys.exec_prefix = ‘/usr’*
  • sys.path = [*
  • ‘/usr/lib64/python38.zip’,*
  • ‘/usr/lib64/python3.8’,*
  • ‘/usr/lib64/python3.8/lib-dynload’,*
  • ]*
    Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
    Python runtime state: core initialized
    LookupError: no codec search functions registered: can’t find encoding

Current thread 0x00007fe0ee244740 (most recent call first):

Please help me!!! :wink:

Sorry about the electricity issue. You had an incomplete dnf update session so you need to look at the dnf logs (/var/log/dnf*) and find out where it went wrong. You may need to use rpm command to restore the package database. Have you checked to see if rpm still works?

try

sudo rpm --test

thank you for reply!
tried
[furer@localhost ~]$ sudo rpm --test - displays nothing…

what do you get if you run just python3 -V?

Python 3.8.5
:grinning:

Sorry, that command was incomplete.
However, at what stage of the update did it go off – during downloads, during installation, or during verification? Are you keeping downloaded packages (caching)?

tried some hints - but nothing helped :frowning:
reinstalled the system last night - THANKS ALL for the help :slight_smile:

A post was split to a new topic: Power outtage while DNF was updating, and now I get “libdnf/_conf.so: undefined symbol”