From 0e1a1b9c30720fc8ca3e3a2514654fb3c726a861 Mon Sep 17 00:00:00 2001 From: kylecarbs Date: Thu, 16 Jun 2022 00:42:00 +0000 Subject: [PATCH] fix: Force keeping old files to prevent dpkg failure on update Updating a release if system files failed would result in failure from the install script. This fixes it! --- install.sh | 2 +- preinstall.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index db89cf67b8946..e9c826350154c 100755 --- a/install.sh +++ b/install.sh @@ -329,7 +329,7 @@ install_deb() { fetch "https://github.com/coder/coder/releases/download/v$VERSION/coder_${VERSION}_${OS}_${ARCH}.deb" \ "$CACHE_DIR/coder_${VERSION}_$ARCH.deb" - sudo_sh_c dpkg -i "$CACHE_DIR/coder_${VERSION}_$ARCH.deb" + sudo_sh_c dpkg --force-confdef --force-confold -i "$CACHE_DIR/coder_${VERSION}_$ARCH.deb" echo_systemd_postinstall deb } diff --git a/preinstall.sh b/preinstall.sh index a343836c90b6d..932dab26b04f7 100644 --- a/preinstall.sh +++ b/preinstall.sh @@ -6,6 +6,7 @@ USER="coder" # Add a Coder user to run as in systemd. if ! id -u $USER >/dev/null 2>&1; then useradd \ + --create-home \ --system \ --user-group \ --shell /bin/false \