debian12源更新脚本

This commit is contained in:
Yann Lau
2025-06-01 16:12:35 +08:00
parent 76565c017c
commit bb27178cfe

View File

@@ -0,0 +1,19 @@
#!/bin/bash
# 备份原始 sources.list 文件
cp /etc/apt/sources.list /etc/apt/sources.list.bak
# 覆盖写入新的 sources.list 内容
cat > /etc/apt/sources.list << EOF
deb https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main
deb https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-updates main non-free non-free-firmware contrib
deb https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
deb-src https://mirrors.aliyun.com/debian/ bookworm-backports main non-free non-free-firmware contrib
EOF
# 输出提示信息
echo "sources.list 已更新,备份文件为 /etc/apt/sources.list.bak"