From c064cef77e8ca8cc717a0ce5a2f51708e3530610 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 2 Oct 2024 03:45:01 +0200 Subject: [PATCH] qvm-template-repo-query: don't set pluginpath for DNF5 Setting pluginpath makes DNF5 look for plugin configs for every installed libdnf plugin. If any is missing, it fails to start. Since the downloadurl plugin isn't applicable to DNF5 don't set alternative pluginpath to avoid the problem of missing configs for other plugins. QubesOS/qubes-issues#9244 (cherry picked from commit 467d0cafc2b44169d3dcca2d84ba8842c135dc78) --- qubes-rpc/qvm-template-repo-query | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/qubes-rpc/qvm-template-repo-query b/qubes-rpc/qvm-template-repo-query index 2e78cb7c..7f57ad44 100755 --- a/qubes-rpc/qvm-template-repo-query +++ b/qubes-rpc/qvm-template-repo-query @@ -26,11 +26,18 @@ repodir=$(mktemp -d) trap 'rm -r "$repodir"' EXIT cat > "$repodir/template.repo" +DNF5=false +if [ "$(readlink /usr/bin/dnf)" = "dnf5" ]; then + DNF5=true +fi + OPTS+=(-y "--setopt=reposdir=${repodir}" --quiet) -# use vendored 'downloadurl' dnf-plugin (fork of 'download' plugin), to print -# all mirrors -OPTS+=("--setopt=pluginpath=/usr/lib/qubes/dnf-plugins") +if ! $DNF5; then + # use vendored 'downloadurl' dnf-plugin (fork of 'download' plugin), to print + # all mirrors + OPTS+=("--setopt=pluginpath=/usr/lib/qubes/dnf-plugins") +fi if ! command -v dnf >/dev/null; then echo "ERROR: dnf command is missing, please use newer template for your UpdateVM to download templates." >&2