Debian 11 / 12 手动修改镜像源

备份现有apt源配置

1
mv /etc/apt/sources.list /etc/apt/sources.list.old

Debian 11

全部复制后,直接粘贴并按下回车执行

官方源

1
2
3
4
5
6
7
8
9
10
cat > /etc/apt/sources.list << EOF
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb-src http://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
deb-src http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
EOF

或者去掉源码包,提高apt update的速度

1
2
3
4
5
6
cat << EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian/ bullseye main contrib non-free
deb http://deb.debian.org/debian/ bullseye-updates main contrib non-free
deb http://deb.debian.org/debian/ bullseye-backports main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
EOF

阿里云镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib
deb http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb-src http://mirrors.aliyun.com/debian-security/ bullseye-security main
deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib
EOF

腾讯云镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.tencent.com/debian/ bullseye main non-free contrib
deb http://mirrors.tencent.com/debian-security/ bullseye-security main
deb-src http://mirrors.tencent.com/debian-security/ bullseye-security main
deb https://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.tencent.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.tencent.com/debian/ bullseye-backports main non-free contrib
EOF

网易镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.163.com/debian/ bullseye main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye main non-free contrib
deb http://mirrors.163.com/debian-security/ bullseye-security main
deb-src http://mirrors.163.com/debian-security/ bullseye-security main
deb http://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye-updates main non-free contrib
deb http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
deb-src http://mirrors.163.com/debian/ bullseye-backports main non-free contrib
EOF

清华大学镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
EOF

Debian 12

全部复制后,直接粘贴并按下回车执行

官方源

1
2
3
4
5
6
7
8
9
10
cat > /etc/apt/sources.list << EOF
deb http://deb.debian.org/debian/ bookworm main contrib non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm main contrib non-free-firmware
deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-updates main contrib non-free-firmware
deb http://deb.debian.org/debian/ bookworm-backports main contrib non-free-firmware
deb-src http://deb.debian.org/debian/ bookworm-backports main contrib non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free-firmware
deb-src http://deb.debian.org/debian-security/ bookworm-security main contrib non-free-firmware
EOF

或者去掉源码包,提高apt update的速度

1
2
3
4
5
6
cat << EOF > /etc/apt/sources.list
deb http://deb.debian.org/debian/ bookworm main contrib non-free-firmware
deb http://deb.debian.org/debian/ bookworm-updates main contrib non-free-firmware
deb http://deb.debian.org/debian/ bookworm-backports main contrib non-free-firmware
deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free-firmware
EOF

阿里云镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian/ bookworm main non-free-firmware contrib
deb-src http://mirrors.aliyun.com/debian/ bookworm main non-free-firmware contrib
deb http://mirrors.aliyun.com/debian-security/ bookworm-security main
deb-src http://mirrors.aliyun.com/debian-security/ bookworm-security main
deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware contrib
deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware contrib
deb http://mirrors.aliyun.com/debian/ bookworm-backports main non-free-firmware contrib
deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main non-free-firmware contrib
EOF

腾讯云镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.tencent.com/debian/ bookworm main non-free-firmware contrib
deb-src http://mirrors.tencent.com/debian/ bookworm main non-free-firmware contrib
deb http://mirrors.tencent.com/debian-security/ bookworm-security main
deb-src http://mirrors.tencent.com/debian-security/ bookworm-security main
deb https://mirrors.tencent.com/debian/ bookworm-updates main non-free-firmware contrib
deb-src http://mirrors.tencent.com/debian/ bookworm-updates main non-free-firmware contrib
deb http://mirrors.tencent.com/debian/ bookworm-backports main non-free-firmware contrib
deb-src http://mirrors.tencent.com/debian/ bookworm-backports main non-free-firmware contrib
EOF

网易镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.163.com/debian/ bookworm main non-free-firmware contrib
deb-src http://mirrors.163.com/debian/ bookworm main non-free-firmware contrib
deb http://mirrors.163.com/debian-security/ bookworm-security main
deb-src http://mirrors.163.com/debian-security/ bookworm-security main
deb http://mirrors.163.com/debian/ bookworm-updates main non-free-firmware contrib
deb-src http://mirrors.163.com/debian/ bookworm-updates main non-free-firmware contrib
deb http://mirrors.163.com/debian/ bookworm-backports main non-free-firmware contrib
deb-src http://mirrors.163.com/debian/ bookworm-backports main non-free-firmware contrib
EOF

清华大学镜像站

1
2
3
4
5
6
7
8
9
10
cat << EOF > /etc/apt/sources.list
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free-firmware
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free-firmware
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free-firmware
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free-firmware
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free-firmware
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free-firmware
deb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free-firmware
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free-firmware
EOF