[pkgselectprocess] Add a more robust check for apt packages when installing them (LP: #2089494).

ubuntu/plucky
Simon Quigley 4 weeks ago
parent 9284c1f21b
commit e24341cb0e

@ -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,

2
debian/changelog vendored

@ -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 <tsimonq2@ubuntu.com> Sun, 24 Nov 2024 20:22:55 -0600

Loading…
Cancel
Save