树莓派更换国内镜像

Posted by Yuanyeex on Sunday, April 18, 2021

首先备份默认的源配置文件:

cd /etc/apt/;
sudo cp sources.list sources.list.bak
sudo cp sources.list.d sources.list.d.bak

修改sources.listsources.list.d/raspi.list中的内容,将源设置为中科大的源。

修改后的sources.list:

pi@raspberrypi:/etc/apt $ cat sources.list
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

修改后的sources.list.d/raspi.list

pi@raspberrypi:/etc/apt $ cat sources.list.d/raspi.list
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/ stretch main ui

运行sudo apt update,这时候数据源以及切换到中科大的镜像了:

pi@raspberrypi:/etc/apt $ sudo apt update
Get:1 http://mirrors.ustc.edu.cn/raspbian/raspbian stretch InRelease [15.0 kB]
Get:2 http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian stretch InRelease [25.4 kB]
Get:3 http://mirrors.ustc.edu.cn/raspbian/raspbian stretch/main armhf Packages [11.7 MB]
Get:4 http://mirrors.ustc.edu.cn/raspbian/raspbian stretch/contrib armhf Packages [56.9 kB]
Get:5 http://mirrors.ustc.edu.cn/raspbian/raspbian stretch/non-free armhf Packages [98.9 kB]
Get:6 http://mirrors.ustc.edu.cn/raspbian/raspbian stretch/rpi armhf Packages [1,360 B]
Get:7 http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian stretch/main armhf Packages [192 kB]
Get:8 http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian stretch/ui armhf Packages [45.0 kB]
Fetched 12.1 MB in 7s (1,782 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 package can be upgraded. Run 'apt list --upgradable' to see it.

「真诚赞赏,手留余香」

Yuanyeex

真诚赞赏,手留余香

使用微信扫描二维码完成支付