From a35af3f38b5c2254fe4c5644575f2e65c99b1e57 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Mon, 20 Jun 2022 14:29:19 -0700 Subject: [PATCH] install/upgrade: Allow new packages during `apt-get upgrade`. `postgresql-14.4` is a notable upgrade in the PostgreSQL series, as it fixes potential database corruption from `CREATE INDEX CONCURRENTLY` statements which are run while rows are modified[1]. However, it also requires an upgrade from `libllvm9` to `libllvm10`, which means it is not installed by a mere `apt-get upgrade`. Add the `--with-new-pkgs` flag to all of the potentially relevant `apt-get upgrade` calls, so that this (and similar) packages are upgraded successfully. [1]: https://www.postgresql.org/docs/release/14.4/ --- scripts/lib/install | 2 +- scripts/lib/upgrade-zulip-stage-2 | 4 ++-- tools/setup/bootstrap-aws-installer | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/lib/install b/scripts/lib/install index e28829d13c..d3d1e1f916 100755 --- a/scripts/lib/install +++ b/scripts/lib/install @@ -452,7 +452,7 @@ fi "$ZULIP_PATH"/scripts/zulip-puppet-apply -f if [ "$package_system" = apt ]; then - apt-get -y upgrade + apt-get -y --with-new-pkgs upgrade elif [ "$package_system" = yum ]; then # No action is required because `yum update` already does upgrade. : diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2 index 1f01dc80a6..620621f36a 100755 --- a/scripts/lib/upgrade-zulip-stage-2 +++ b/scripts/lib/upgrade-zulip-stage-2 @@ -228,7 +228,7 @@ if glob.glob("/usr/share/postgresql/*/extension/tsearch_extras.control"): if not (minimal_change or args.skip_puppet): logging.info("Upgrading system packages...") subprocess.check_call(["apt-get", "update"]) - subprocess.check_call(["apt-get", "-y", "upgrade"]) + subprocess.check_call(["apt-get", "-y", "--with-new-pkgs", "upgrade"]) # To bootstrap zulip-puppet-apply, we need to install the system yaml # package; new installs get this, but old installs may not have it. @@ -444,7 +444,7 @@ else: shutdown_server() logging.info("Applying Puppet changes...") subprocess.check_call(["./scripts/zulip-puppet-apply", "--force"]) - subprocess.check_call(["apt-get", "-y", "upgrade"]) + subprocess.check_call(["apt-get", "-y", "--with-new-pkgs", "upgrade"]) # Puppet may have reloaded supervisor, and in so doing started # services; mark as potentially needing to stop the server. IS_SERVER_UP = True diff --git a/tools/setup/bootstrap-aws-installer b/tools/setup/bootstrap-aws-installer index 8c1fedfcbc..c864fdc82a 100644 --- a/tools/setup/bootstrap-aws-installer +++ b/tools/setup/bootstrap-aws-installer @@ -36,7 +36,7 @@ export DEBIAN_FRONTEND=noninteractive # Dependencies to install AWS CLI ( apt-get -qy update - apt-get -qy -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade + apt-get -qy --with-new-pkgs -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" upgrade apt-get -qy install jq unzip curl apt-get -qy autoclean )