注意本教程仅支持 raspbian 2018-04-19 之后的镜像

1.替换为中科大源

sudo sed -i 's|raspbian.raspberrypi.org|mirrors.ustc.edu.cn/raspbian|g' /etc/apt/sources.list
sudo sed -i 's|//archive.raspberrypi.org|//mirrors.ustc.edu.cn/archive.raspberrypi.org|g' /etc/apt/sources.list.d/raspi.list
sudo apt update

2.替换为阿里云的源(阿里云没有archive源,这里archive 使用中科大的)

sudo sed -i 's|raspbian.raspberrypi.org|mirrors.aliyun.com/raspbian|g' /etc/apt/sources.list 
sudo sed -i 's|//archive.raspberrypi.org|//mirrors.ustc.edu.cn/archive.raspberrypi.org|g' /etc/apt/sources.list.d/raspi.list 
sudo apt update