debian12 更换镜像源
备份现有镜像
Section titled “备份现有镜像”mv /etc/apt/sources.list /etc/apt/sources.list.$(date +%Y%m%d%H%M%S)
cat > /etc/apt/sources.list << EOFdeb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
cat > /etc/apt/sources.list << EOFdeb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
cat > /etc/apt/sources.list << EOFdeb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
cat > /etc/apt/sources.list << EOFdeb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
cat > /etc/apt/sources.list << EOFdeb http://mirrors.cloud.aliyuncs.com/debian/ bookworm main contrib non-free non-free-firmwaredeb-src http://mirrors.cloud.aliyuncs.com/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors.cloud.aliyuncs.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src http://mirrors.cloud.aliyuncs.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors.cloud.aliyuncs.com/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src http://mirrors.cloud.aliyuncs.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb http://mirrors.cloud.aliyuncs.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src http://mirrors.cloud.aliyuncs.com/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
cat > /etc/apt/sources.list << EOFdeb https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://mirrors.cloud.tencent.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://mirrors.cloud.tencent.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF
cat > /etc/apt/sources.list << EOFdeb http://mirrors.tencentyun.com/debian/ bookworm main contrib non-free non-free-firmwaredeb-src http://mirrors.tencentyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors.tencentyun.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src http://mirrors.tencentyun.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors.tencentyun.com/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src http://mirrors.tencentyun.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb http://mirrors.tencentyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src http://mirrors.tencentyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwareEOF