This commit is contained in:
@@ -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文件,严格配置权限
|
||||
|
||||
Reference in New Issue
Block a user