diff --git a/common/modules/pkgselectprocess/PackageSelectProcess.cpp b/common/modules/pkgselectprocess/PackageSelectProcess.cpp index 875202d..d50a86d 100644 --- a/common/modules/pkgselectprocess/PackageSelectProcess.cpp +++ b/common/modules/pkgselectprocess/PackageSelectProcess.cpp @@ -361,7 +361,14 @@ Calamares::JobResult PackageSelectProcess::exec() if (!debPackages.isEmpty()) { const QString packageList = debPackages.join(" "); const QString installCommand = QString( - "DEBIAN_FRONTEND=noninteractive apt-get -y install $(for pkg in %1; do dpkg -s \"$pkg\" &>/dev/null || echo -n \"$pkg \"; done)" + "packages_to_install=$(for pkg in %1; do " + "if ! dpkg -s \"$pkg\" &>/dev/null && apt-cache show \"$pkg\" &>/dev/null; then " + "printf \"%s \" \"$pkg\"; " + "fi; " + "done); " + "if [ -n \"$packages_to_install\" ]; then " + "DEBIAN_FRONTEND=noninteractive apt-get -y install $packages_to_install; " + "fi" ).arg(packageList); Calamares::JobResult installResult = runAptCommand(installCommand, diff --git a/debian/changelog b/debian/changelog index 98e0c40..3e98575 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ calamares-settings-ubuntu (1:25.04.10) UNRELEASED; urgency=medium * [pkgselectprocess] Add dpkg diversions for dracut, update-initramfs, and locale-gen. These will be called later in the process. + * [pkgselectprocess] Add a more robust check for apt packages when + installing them (LP: #2089494). -- Simon Quigley Sun, 24 Nov 2024 20:22:55 -0600