Fixing Fedora 24 dnf problems.

The short story:

If you are getting the following error when trying to install software using dnf in fedora 24:

python3: /builddir/build/BUILD/hawkey-0.6.3/src/python/exception-py.c:101: ret2e: Assertion `0′ failed.

You may try doing:

dnf --disablerepo=updates <package>

Where <package> is the thing you are trying to install.

The long story:

Today, I was working on a site on my newly installed Fedora 24, but the drupal-based site failed to show anything after I updated a block. All non-admin pages would just show blank. So I started tracking code, and at some point it occurred to me that maybe I had to run the update script, which fixed the problem. I still don’t know why updating the content of a block would cause the site to break, but my guess is that it has to do with drupal caches. This because the function that failed is called “block_page_build”. Anyway, before I could run the update script, drupal was complaining about some missing php components, so I wanted to install them.

I went ahead and did

dnf install php-xml

but that returned an error (see the short story above). I didn’t know what to do, so I started searching the web, but found nothing. Then I turned to the dnf manual. In there I saw you can add -v to get a more verbose output. Running dnf with -v got me this:

cachedir: /var/cache/dnf
 Loaded plugins: config-manager, protected_packages, generate_completion_cache, Query, builddep, langpacks, debuginfo-install, download, needs-restarting, playground, reposync, noroot, copr
 langpacks: No languages are enabled
 Error reading file : /var/lib/dnf/plugins/langpacks/installed_langpacks as it does not exist
 initialized Langpacks plugin
 DNF version: 1.1.10
 repo: using cache for: fedora
 not found deltainfo for: Fedora 24 - x86_64
 not found updateinfo for: Fedora 24 - x86_64
 repo: using cache for: google-chrome
 not found deltainfo for: google-chrome
 not found updateinfo for: google-chrome
 repo: using cache for: updates
 python3: /builddir/build/BUILD/hawkey-0.6.3/src/python/exception-py.c:101: ret2e: Assertion `0' failed.

Look at that! the problem happens right after trying to use the updates repo.

I had read in the dnf man page that there is a location where the repo files are kept, so I went and moved all update repos out of the directory where they are kept, and run dnf install again. It worked.

Well, all that was left to do was find a proper way to ignore repos when doing installs, and the man page had the answer: –disablerepo

So, that is the story. Keep coding kids.