Skip to content

Recommend --use-host-config if --installroot is used and not all repositories can be enabled #1760

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions dnf5/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,16 @@ void Context::Impl::apply_repository_setopts() {
}

if (!missing_repo_ids.empty()) {
throw libdnf5::cli::ArgumentParserError(
M_("No matching repositories for \"{}\""), libdnf5::utils::string::join(missing_repo_ids, ", "));
auto missing_repo_ids_string = libdnf5::utils::string::join(missing_repo_ids, _(", "));
if (base.get_config().get_installroot_option().get_value() != "/" &&
!base.get_config().get_use_host_config_option().get_value()) {
throw libdnf5::cli::ArgumentParserError(
M_("No matching repositories for {}. To use repositories from a host system, pass --use-host-config "
"option"),
missing_repo_ids_string);
} else {
throw libdnf5::cli::ArgumentParserError(M_("No matching repositories for {}"), missing_repo_ids_string);
}
}
}

Expand Down
Loading