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