Description of problem:
I'm using dnf inside a test script to resolve dependencies and download RPMs locally. The following command works fine:
# dnf install --releasever=26 --downloadonly --downloaddir=/tmp/dnf.download.2 --installroot=/tmp/dnf.root.2 java-1.8.0-openjdk-1.8.0.*
however it requires root privileges and we want to run as non-root. So I tried:
$ dnf download -v --releasever=26 --resolve --best --forcearch x86_64 --downloaddir=/tmp/dnf.download.1 --installroot=/tmp/dnf.install.1 java-1.8.0-openjdk-1.8.0.*
This fails with:
Error in resolve
After adding some debugging into to download.py
for msg in goal.problems:
package java-1.8.0-openjdk-1:126.96.36.199-7.b12.fc26.i686 requires java-1.8.0-openjdk-headless(x86-32) = 1:188.8.131.52-7.b12.fc26, but none of the providers can be installed
Version-Release number of selected component (if applicable):
Looking at the code inside download.py I get the feeling that the underlying hawkey.Goal object is not setup properly. In any case there is a self._goal object created in dnf's base.py so maybe use that.
Please can you try "dnf download -v --releasever=26 --resolve --best --forcearch x86_64 --downloaddir=/tmp/dnf.download.1 --installroot=/tmp/dnf.install.1 java-1.8.0-openjdk-1.8.0.*.x86_64"
The reason why you experience the problem is that it tries to resolve the transaction for i686 package together with x86_64 package. Unfortunately download always tries to handle every architecture, therefore in some combination it provides different result then install command. But I think that the real issue here is reporting of errors, therefore I created a patch that should enhance behavior (https://github.com/rpm-software-management/dnf-plugins-core/pull/248). Hope that it helps.
The issue is solved by dnf-plugins-core-3.0.1-1 that was released into rawhide.