From ff9984f4a9c55577f29c6290983d5f9b928d69c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=94=E5=BF=B5?= <12574910+72wo@users.noreply.github.com> Date: Fri, 30 Jan 2026 00:15:44 +0800 Subject: [PATCH] 1 --- .woodpecker/my-first-workflow.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.woodpecker/my-first-workflow.yaml b/.woodpecker/my-first-workflow.yaml index 02d296a35..d8c357ecc 100644 --- a/.woodpecker/my-first-workflow.yaml +++ b/.woodpecker/my-first-workflow.yaml @@ -31,7 +31,21 @@ steps: # - env | grep -i ssh || echo "⚠️ 无SSH相关环境变量" # 系统初始化 - - apt update -y + # 1. 备份原有软件源文件(防止出错可恢复) + - sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak + + # 2. 清空原有内容,写入阿里云Debian bookworm镜像源(直接覆盖,无需手动编辑) + - | + sudo cat > /etc/apt/sources.list << EOF + # 阿里云Debian 12 (bookworm) 镜像源 + deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware + deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware + deb http://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware + deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware + EOF + + # 3. 更新软件源缓存(使新源生效) + - sudo apt update - apt install -y --no-install-recommends curl git openssh-client openssl libssl-dev # # 清理旧SSH文件,严格配置权限