在树莓派上安装软件时候,经常遇到无法找到软件包或者下载速度过慢等情况,这时候我们需要更换软件源。
-
首先,打开/etc/apt/sources.list
sudo nano /etc/apt/sources.list
- 用#注释掉旧源,方法将
- 更换新源,将如下源任选其一粘贴进去
-
更新软件源
sudo apt-get upgrade
deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib$ deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main con$ #deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' #deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-fre$
改为
#deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib$ #deb-src http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main con$ #deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi # Uncomment line below then 'apt-get update' to enable 'apt-get source' #deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-fre$
1.阿里云提供
deb http://mirrors.aliyun.com/raspbian/raspbian/ jessie main contrib non-free rpi deb-src http://mirrors.aliyun.com/raspbian/raspbian/ jessie main contrib non-free rpi2.中科大提供
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ wheezy main contrib non-free rpi
发表评论