# 先备份
mv /etc/apt/sources.list /etc/apt/sources.list.bak
# 生成国内的源配置文件
echo "deb http://ftp.cn.debian.org/debian/ stretch main" > /etc/apt/sources.list
echo "deb http://ftp.cn.debian.org/debian/ stretch-updates main" >> /etc/apt/sources.list
echo "deb http://ftp.cn.debian.org/debian-security stretch/updates main" >> /etc/apt/sources.list
# 更新源
apt update
原文:https://www.cnblogs.com/taadis/p/12110889.html