1.更换镜像源
sudo nano /etc/apt/sources.list
1.1注释第一行,添加国内源,如下:
#deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
按ctrl + o ,enter保存,ctrl + x 关闭;
1.2更换pip源
sudo mkdir ~/.pip
ls .pip
sudo nano pip.conf
将以下内容写入配置文件(为pip配置阿里和豆瓣源):(保存并退出同上)
[global]
timeout = 10
index-url = http://mirrors.aliyun.com/py