Ask Your Question
0

write_main() failed to re-load written solv file

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

Peperud gravatar image

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: https://mirrors.fedoraproject.org/metalink?repo=updates-released-f28&arch=x86_64, mlist: None, urls [].
2018-11-15T00:07:53Z SUBDEBUG
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/dnf/cli/main.py", line 115, in cli_run
    cli.run()
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 1015, in run
    self._process_demands()
  File "/usr/lib/python3.6/site-packages/dnf/cli/cli.py", line 768, in _process_demands
    load_available_repos=self.demands.available_repos)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 475, in fill_sack
    self._add_repo_to_sack(r)
  File "/usr/lib/python3.6/site-packages/dnf/base.py", line 147, in _add_repo_to_sack
    load_updateinfo=True)
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

Comments

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 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2019-02-19 11:20:21 -0500

ajh gravatar image

I am having the same issue; but no past error/power failure explains it and the 'fix' above doesn't work.

edit flag offensive delete link more
0

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

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/misc.py.orig /usr/lib/python2.7/site-packages/yum/misc.py
727c727,728
<                 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

Stats

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

Seen: 391 times

Last updated: Nov 14 '18