一、备份现有apt源配置
mv /etc/apt/sources.list /etc/apt/sources.list.old
二、替换为其他apt源
1. 替换为默认官方源
这是一条命令,全部复制后,直接粘贴然后一起执行。
cat > /etc/apt/sources.list << EOF
deb http://deb.debian.org/debian/ buster main contrib non-free
deb-src http://deb.debian.org/debian/ buster main contrib non-free
deb http://deb.debian.org/debian/ buster-updates main contrib non-free
deb-src http://deb.debian.org/debian/ buster-updates main contrib non-free
deb http://deb.debian.org/debian/ buster-backports main contrib non-free
deb-src http://deb.debian.org/debian/ buster-backports main contrib non-free
deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free
deb-src http://deb.debian.org/debian-security/ buster/updates main contrib non-free
EOF
2. 替换为腾讯云内网源
这是一条命令,全部复制后,直接粘贴然后一起执行。
cat > /etc/apt/sources.list << EOF
deb http://mirrors.tencentyun.com/debian/ buster main contrib non-free
deb-src http://mirrors.tencentyun.com/debian/ buster main contrib non-free
deb http://mirrors.tencentyun.com/debian/ buster-updates main contrib non-free
deb-src http://mirrors.tencentyun.com/debian/ buster-updates main contrib non-free
deb http://mirrors.tencentyun.com/debian/ buster-backports main contrib non-free
deb-src http://mirrors.tencentyun.com/debian/ buster-backports main contrib non-free
deb http://mirrors.tencentyun.com/debian-security/ buster/updates main contrib non-free
deb-src http://mirrors.tencentyun.com/debian-security/ buster/updates main contrib non-free
EOF
3. 替换为阿里云内网源
这是一条命令,全部复制后,直接粘贴然后一起执行。
cat > /etc/apt/sources.list << EOF
deb http://mirrors.cloud.aliyuncs.com/debian/ buster main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ buster main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian/ buster-updates main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ buster-updates main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian/ buster-backports main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian/ buster-backports main contrib non-free
deb http://mirrors.cloud.aliyuncs.com/debian-security/ buster/updates main contrib non-free
deb-src http://mirrors.cloud.aliyuncs.com/debian-security/ buster/updates main contrib non-free
EOF
4. 替换为Linode源
这是一条命令,全部复制后,直接粘贴然后一起执行。
cat > /etc/apt/sources.list << EOF
deb http://mirrors.linode.com/debian/ buster main contrib non-free
deb-src http://mirrors.linode.com/debian/ buster main contrib non-free
deb http://mirrors.linode.com/debian/ buster-updates main contrib non-free
deb-src http://mirrors.linode.com/debian/ buster-updates main contrib non-free
deb http://mirrors.linode.com/debian/ buster-backports main contrib non-free
deb-src http://mirrors.linode.com/debian/ buster-backports main contrib non-free
deb http://mirrors.linode.com/debian-security/ buster/updates main contrib non-free
deb-src http://mirrors.linode.com/debian-security/ buster/updates main contrib non-free
EOF