先备份原本的源list
sudo cp /etc/apt/sources.list /etc/apt/sources.list_bak
用sed命令将 /etc/apt/sources.list 文件中 Debian 默认的源地址 http://deb.debian.org/ 替换为国内源即可
#中国科技大学
sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
#网易云163
sudo sed -i 's/deb.debian.org/mirrors.163.com/g' /etc/apt/sources.list
#阿里云
sudo sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
#清华同方
sudo sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
更新索引以生效
sudo apt-get update
请登录后查看回复内容