Ask Your Question

write_main() failed to re-load written solv file

asked 2018-11-14 18:28:22 -0600

Power went out when running dnf upgrade --refresh. Now dnf throws:

[root@fedora cache]# dnf upgrade --refresh
write_main() failed to re-load written solv file

tail -50 /var/log/dnf.log


2018-11-15T00:06:43Z INFO --- logging initialized ---
2018-11-15T00:06:43Z DDEBUG timer: config: 3 ms
2018-11-15T00:06:43Z DEBUG Loaded plugins: builddep, config-manager, copr, debug, debuginfo-install, download, generate_completion_cache, needs-restarting, playground, repoclosure, repograph, repomanage, reposync
2018-11-15T00:06:43Z DEBUG DNF version: 2.7.5
2018-11-15T00:06:43Z DDEBUG Command: dnf update --refresh
2018-11-15T00:06:43Z DDEBUG Installroot: /
2018-11-15T00:06:43Z DDEBUG Releasever: 28
2018-11-15T00:06:43Z DEBUG cachedir: /var/cache/dnf
2018-11-15T00:06:43Z DDEBUG Base command: update
2018-11-15T00:06:43Z DDEBUG Extra commands: ['update', '--refresh']
2018-11-15T00:06:43Z DDEBUG repo: downloading from remote: updates, _Handle: metalnk:, mlist: None, urls [].
2018-11-15T00:07:53Z SUBDEBUG
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 115, in cli_run
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 1015, in run
  File "/usr/lib/python3.6/site-packages/dnf/cli/", line 768, in _process_demands
  File "/usr/lib/python3.6/site-packages/dnf/", line 475, in fill_sack
  File "/usr/lib/python3.6/site-packages/dnf/", line 147, in _add_repo_to_sack
OSError: write_main() failed to re-load written solv file
2018-11-15T00:07:53Z CRITICAL write_main() failed to re-load written solv file
2018-11-15T00:07:53Z DDEBUG Cleaning up.

if I do dnf clean all and then dnf <pretty-much-anything> it seems to repopulate (perhaps not completely) /var/cache/dnf, but still throws the same error.

edit retag flag offensive close merge delete


Upsetting situation. Are you sure the disk was checked for errors? Is /var/cache ok? Does rpm -qa return the list of all installed packages?

ed209 gravatar imageed209 ( 2018-11-14 20:20:39 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-12-06 20:32:26 -0600

I had the same issue. I managed to fix it by reinstalling dnf using yum-deprecated.

First I had to workaround an issue (" Error: Invalid version flag: if") when running yum-deprecated I did this by:

$ diff /usr/lib/python2.7/site-packages/yum/ /usr/lib/python2.7/site-packages/yum/
<                 raise Errors.MiscError, 'Invalid version flag: %s' % f
>                 #raise Errors.MiscError, 'Invalid version flag: %s' % f
>                 pass

Then I removed libsolv, and all it's dependencies (including dnf)

yum-deprecated remove libsolv

Then I installed dnf again:

yum-deprecated install dnf

Hope this helps...

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


Asked: 2018-11-14 18:28:22 -0600

Seen: 241 times

Last updated: Nov 14 '18