Description of problem: If I do an update_cache() via the DNF python API and then install a package, it causes issues with the transaction check. Example with update_cache: >>> import dnf >>> base = dnf.Base() >>> base.conf.read() >>> base.read_all_repos() >>> base.fill_sack() >>> base.read_comps() >>> base.update_cache() True >>> base.install("git") 1 >>> base.resolve() True >>> base.download_packages(base.transaction.install_set) >>> base.do_transaction() Error: transaction check vs depsolve: coreutils-single conflicts with coreutils-8.30-6.fc29.x86_64 libxcrypt-common <= 4.3.3-3 is obsoleted by libxcrypt-4.4.1-1.fc29.x86_64 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python3.7/site-packages/dnf/base.py", line 820, in do_transaction raise dnf.exceptions.TransactionCheckError(msg) dnf.exceptions.TransactionCheckError: libxcrypt-common <= 4.3.3-3 is obsoleted by libxcrypt-4.4.1-1.fc29.x86_64 libxcrypt-common <= 4.3.3-3 is obsoleted by libxcrypt-4.4.1-1.fc29.x86_64 Example without update_cache: >> import dnf >>> base = dnf.Base() >>> base.conf.read() >>> base.read_all_repos() >>> base.fill_sack() <dnf.sack.Sack object at 0x7f685bc0ff68> >>> base.read_comps() <dnf.comps.Comps object at 0x7f685bc25f28> >>> base.install("git") 1 >>> base.resolve() True >>> base.download_packages(base.transaction.install_set) >>> base.do_transaction() 12 Version-Release number of selected component (if applicable): dnf-4.0.9-1.fc29.noarch How reproducible: Always
Can you run update_cache() before fill_sack()? The steps should be as follows: ... base.conf.read() # read dnf.conf base.read_all_repos() # read /etc/yum.repos.d/*.repo base.update_cache() # update downloaded repodata cache base.fill_sack() # load repodata in memory ... If that works, I'll keep this bug open as a use case for implementing states and workflow for the Base object.
Confirmed, this does work if the order of operations is changed. I'm curious, is that expected order of operations documented anywhere?
Here is an update for documentation of update_metadata (https://github.com/rpm-software-management/dnf/pull/1344). New information ```Do not use after :meth:`fill_sack`, because information about packages will be not updated.``` Is it what you asked for?
Yes, thank you.
dnf-4.2.5-1.fc29 libdnf-0.31.0-2.fc29 has been submitted as an update to Fedora 29. https://bodhi.fedoraproject.org/updates/FEDORA-2019-2612a121ba
dnf-4.2.5-1.fc29, libdnf-0.31.0-2.fc29 has been pushed to the Fedora 29 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-2612a121ba
dnf-4.2.5-1.fc29, libdnf-0.31.0-2.fc29 has been pushed to the Fedora 29 stable repository. If problems still persist, please make note of it in this bug report.