本文作者:chenzj

Debian 12默认官方源/清华源/中科大源/腾讯云源/阿里云源/Linode源sources.list

Debian 12默认官方源/清华源/中科大源/腾讯云源/阿里云源/Linode源sources.list摘要: 一、备份现有apt源配置mv /etc/apt/sources.list /etc/apt/sources.list.old...

一、备份现有apt源配置

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



二、替换为其他apt源

1、替换为默认官方源


这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


2、替换为清华源


这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


3、替换为中科大源


这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


4、替换为腾讯云源


这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
deb https://mirrors.cloud.tencent.com/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src https://mirrors.cloud.tencent.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


使用腾讯云服务器时,可以选择腾讯云内网源,走内网不消耗公网流量。

cat > /etc/apt/sources.list << EOF
deb http://mirrors.tencentyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src http://mirrors.tencentyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


5、替换为阿里云源


这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


使用阿里云服务器时,可以选择阿里云内网源,走内网不消耗公网流量。

cat > /etc/apt/sources.list << EOF
deb http://mirrors.cloud.aliyuncs.com/debian/ bookworm main contrib non-free non-free-firmware
deb-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-firmware
deb-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-firmware
deb-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-firmware
deb-src http://mirrors.cloud.aliyuncs.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


6、替换为Linode源(不支持HTTPS)


这是一条命令,全部复制后,直接粘贴然后一起执行。

cat > /etc/apt/sources.list << EOF
deb http://mirrors.linode.com/debian/ bookworm main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian/ bookworm main contrib non-free non-free-firmware
deb http://mirrors.linode.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian/ bookworm-updates main contrib non-free non-free-firmware
deb http://mirrors.linode.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian/ bookworm-backports main contrib non-free non-free-firmware
deb http://mirrors.linode.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src http://mirrors.linode.com/debian-security/ bookworm-security main contrib non-free non-free-firmware
EOF


三、更新apt索引

apt update


下载.jpg

文章版权及转载声明

作者:chenzj本文地址:https://www.kjjs.net/192.html发布于 03-06
文章转载或复制请以超链接形式并注明出处KJ技术

阅读
分享

发表评论

快捷回复:

评论列表 (暂无评论,51人围观)参与讨论

还没有评论,来说两句吧...