一、备份现有apt源配置
mv /etc/apt/sources.list /etc/apt/sources.list.old
二、替换为其他apt源
1、替换为阿里云源
这是一条命令,全部复制后,直接粘贴然后一起执行。
cat > /etc/apt/sources.list << EOF deb https://mirrors.aliyun.com/debian/ bullseye main contrib non-free deb-src https://mirrors.aliyun.com/debian/ bullseye main contrib non-free deb https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main contrib non-free deb https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main contrib non-free deb https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main contrib non-free EOF
三、更新apt索引
apt update