diff --git a/ocaml/xapi/repository.ml b/ocaml/xapi/repository.ml index b1f6a2875a..ac0b2e3f6d 100644 --- a/ocaml/xapi/repository.ml +++ b/ocaml/xapi/repository.ml @@ -293,7 +293,11 @@ let sync ~__context ~self ~token ~token_id ~username ~password = * will always write_initial_yum_config every time before syncing repo, * this should be ok. *) - write_initial_yum_config ~binary_url + match Pkgs.manager with + | Yum -> + write_initial_yum_config ~binary_url + | Dnf -> + Unixext.unlink_safe !Xapi_globs.dnf_repo_config_file ) ; (* The custom yum-utils will fully download repository metadata including * the repo gpg signature. diff --git a/ocaml/xapi/xapi_globs.ml b/ocaml/xapi/xapi_globs.ml index fcbc9174e9..e05a43e598 100644 --- a/ocaml/xapi/xapi_globs.ml +++ b/ocaml/xapi/xapi_globs.ml @@ -972,6 +972,9 @@ let pvsproxy_close_cache_vdi = ref "/opt/citrix/pvsproxy/close-cache-vdi.sh" let yum_repos_config_dir = ref "/etc/yum.repos.d" +let dnf_repo_config_file = + ref "/etc/dnf/repos.override.d/99-config_manager.repo" + let remote_repository_prefix = ref "remote" let bundle_repository_prefix = ref "bundle"