From 7f1c70c232f508e89f1112e5adb0d955dc82ffdf Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 12 Sep 2023 13:46:50 +0200 Subject: [PATCH] fix: [base] make ``apt-get update`` pass on debian 10 after release info change --- precise/base-0k/hooks/install.d/00-base.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/precise/base-0k/hooks/install.d/00-base.sh b/precise/base-0k/hooks/install.d/00-base.sh index 9fdc586..0bba037 100755 --- a/precise/base-0k/hooks/install.d/00-base.sh +++ b/precise/base-0k/hooks/install.d/00-base.sh @@ -42,6 +42,7 @@ apt:update() { old_tried_length="${#tried[@]}" failed_fetch=$(printf "%s" "$out" | egrep "^E: Failed to fetch .*404\s+Not Found") failed_release=$(printf "%s" "$out" | egrep "^[EW]: The repository '.*' does (no longer|not) have a Release file.$") + changed_release=$(printf "%s" "$out" | egrep "^[EW]: Repository '.*' changed its 'Suite' value from .* to .*$") if [[ " ${tried[*]} " != *" stretch-updates-fix "* ]] && [[ "$failed_fetch" == *" http://archive.debian.org/dists/stretch/updates/"* ]]; then tried+=("stretch-updates-fix") @@ -70,6 +71,14 @@ apt:update() { /etc/apt/sources.list fi + if [[ " ${tried[*]} " != *" change-release-fix "* ]] && + [[ "$changed_release" == *"'http://deb.debian.org/debian "* ]]; then + tried+=("change-release-fix") + echo "Applying change-release-fix" + apt-get update --allow-releaseinfo-change