备份源文件:

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak   
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak

修改软件更新源,执行如下命令:

sudo nano /etc/apt/sources.list

按i进入编辑模式,改成清华的软件源地址,按ESC退出,然后 :x 回车保存退出。

deb http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
deb-src http://mirror.tuna.tsinghua.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi

修改系统更新源,执行如下命令:

sudo nano /etc/apt/sources.list.d/raspi.list

将原镜像用#号注释掉,然后插入清华的系统源地址,保存退出:

deb http://mirror.tuna.tsinghua.edu.cn/raspberrypi/ buster main ui

同步更新源及更新软件包,执行如下命令:

sudo apt-get update
sudo apt-get upgrade