Description of problem: There is no option to make dnf fail early if repo is broken. If there are multiple repositories (for example, Fedora base and a local repository providing newer versions for some packages), and local repo is unavailable 1) fetching local repo information will fail with message to stderr, 2) version from Fedora repository will be installed, 3) dnf exits with 0 dnf version: Version : 2.7.5 Release : 2.fc27 How reproducible: Always with simple setup steps. Steps to Reproduce: 1. Add a new repository 2. Change repository URL to non-existing (domain or path) 3. Run "dnf install <whatever package> Actual results: dnf outputs to stderr: > Failed to synchronize cache for repo '<repo name>', disabling. and continues the process, installing package if if is available in any repository that was working. Expected results: dnf exiting with !=0, possibly when additional option is specified (--abort-on-warning or something similar). Additional info:
Hi, does your repo file contain 'skip-if-unavailable=False'? If not, dnf ends with 0, which is correct.
Ah-ha. Yes, setting 'skip-if-unavailable=False' fixes the issue. Sorry, I assumed finding this from dnf man page (or with googling), and I didn't check configuration reference thoroughly.
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days