[MODIFY] stretch_install_system.sh
Wrap the add-apt-repository calls (lines 18–19) with a retry helper:
+function retry_cmd {
+ local max_attempts=3
+ local delay=5
+ local attempt=1
+ while true; do
+ "$@" && return 0
+ if (( attempt >= max_attempts )); then
+ echo "ERROR: Command failed after $max_attempts attempts: $*"
+ return 1
+ fi
+ echo "Attempt $attempt failed. Retrying in ${delay}s..."
+ sleep $delay
+ ((attempt++))
+ ((delay *= 2))
+ done
+}
+
echo "Apt update & upgrade (this might take a while)"
-sudo apt-add-repository universe -y >> $REDIRECT_LOGFILE
-sudo add-apt-repository -y ppa:kobuk-team/intel-graphics >> $REDIRECT_LOGFILE
+retry_cmd sudo apt-add-repository universe -y >> $REDIRECT_LOGFILE
+retry_cmd sudo add-apt-repository -y ppa:kobuk-team/intel-graphics >> $REDIRECT_LOGFILE
[MODIFY] stretch_install_system.sh
Wrap the
add-apt-repositorycalls (lines 18–19) with a retry helper: