fix: preserve apt network selection

This commit is contained in:
wlx committed 2026-08-06 17:35:01 +08:00
1 parent 78aeaec170
commit de384796c4
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -36,7 +36,7 @@ sudo TIMEZONE_NAME=Asia/Shanghai RUN_UPGRADE=1 \
./scripts/bootstrap-ubuntu-22.04.sh ./scripts/bootstrap-ubuntu-22.04.sh
~~~ ~~~
脚本使用 Docker 官方 apt 仓库,默认强制 IPv4、重试下载并校验官方 GPG 指纹;不修改网络地址、不自动打开防火墙端口,也不会替代现场重启决策。若出现 /var/run/reboot-required,先记下结果,再重启并重新确认 IP、SSH、磁盘和 Docker。 脚本使用 Docker 官方 apt 仓库,默认只对密钥下载强制 IPv4、重试下载并校验官方 GPG 指纹;APT 保持系统网络策略,避免影响现有 Ubuntu 镜像源。不修改网络地址、不自动打开防火墙端口,也不会替代现场重启决策。若出现 /var/run/reboot-required,先记下结果,再重启并重新确认 IP、SSH、磁盘和 Docker。
## 3. 放置并核对源码 ## 3. 放置并核对源码
+3
View File
@@ -24,6 +24,7 @@ docker_repository_url="${DOCKER_REPOSITORY_URL:-https://download.docker.com/linu
docker_gpg_url="${DOCKER_GPG_URL:-${docker_repository_url}/gpg}" docker_gpg_url="${DOCKER_GPG_URL:-${docker_repository_url}/gpg}"
docker_gpg_fingerprint="9DC858229FC7DD38854AE2D88D81803C0EBFCD88" docker_gpg_fingerprint="9DC858229FC7DD38854AE2D88D81803C0EBFCD88"
docker_force_ipv4="${DOCKER_FORCE_IPV4:-1}" docker_force_ipv4="${DOCKER_FORCE_IPV4:-1}"
docker_apt_force_ipv4="${DOCKER_APT_FORCE_IPV4:-0}"
"${sudo_command[@]}" timedatectl set-timezone "$timezone_name" "${sudo_command[@]}" timedatectl set-timezone "$timezone_name"
"${sudo_command[@]}" apt-get update "${sudo_command[@]}" apt-get update
@@ -48,6 +49,8 @@ docker_curl_options=(
docker_apt_options=() docker_apt_options=()
if [[ "$docker_force_ipv4" == "1" ]]; then if [[ "$docker_force_ipv4" == "1" ]]; then
docker_curl_options+=(--ipv4) docker_curl_options+=(--ipv4)
fi
if [[ "$docker_apt_force_ipv4" == "1" ]]; then
docker_apt_options+=(-o Acquire::ForceIPv4=true) docker_apt_options+=(-o Acquire::ForceIPv4=true)
fi fi