树莓派3更新国内源

新购了一个树莓派3,但是更新安装软件时巨慢无比,一个22MB的软件包安装了一天,都各种安装失败,遂更换镜像源。

1、获取树莓派镜像列表

列表如下:http://www.raspbian.org/RaspbianMirrors

2、修改raspberry /etc/apt/sources.list文件。

原内容如下:

deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then ‘apt-get update’ to enable ‘apt-get source’
#deb-src http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi

更新为阿里云后如下:

deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free rpi

注意:只需要更改http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/部分,后面的jessie main non-free contrib各版本系统均不一样,酌情修改。

3、更新/etc/apt/sources.list.d/raspi.list

同上述一样。但是更改后还是有问题,最终我就把这个文件内容全部#注释了。

4、更新源

sudo apt-get update -y

sudo apt-get upgrade -y