一.出错情景
今天把去年的树莓派拿出来用,apt-get update 更新源的时候报错:
The repository 'http://mirrors.ustc.edu.cn/archive.raspberrypi.org stretch Release' does no longer have a Release file
我访问了下源的地址,进去看了下他的README.txt,原来现在人家的源都用的ipv6了,README.txt内容:
If you would like to mirror this repository, please use the following command:
rsync --archive --verbose --delete --delete-delay --delay-updates apt-repo.raspberrypi.org::archive /path/to/local/mirror
Note that apt-repo.raspberrypi.org is IPv6 only, so you will need a native IPv6 address to access it. If you don't have an IPv6 address you will need to set up an IPv6 tunnel.
我们自己的配网除非也是ipv6不然无法访问,所以改源呗。
二.版本树莓派确认
系统版本分为两大类,jessie和stretch,通过命令lsb_release -a 查看自己的版本,我的版本是stretch,换的源要和版本对应。
三.换源
我的是streach版本的,国内的源地址百度一下,据说清华的源好用,据说。。。我用了清华的源,有效。
具体操作是换掉两个文件的源:
(1)
执行命令:sudo nano /etc/apt/sources.list.d/raspi.list
打开后注释之前的源地址,用下面的源替换
清华的源:deb https://mirrors.tuna.tsinghua.edu.cn/raspberrypi/ stretch main ui
这个文件的源可下载驱动软件,用的不多,保持统一,一起换了。
(2)
执行命令:sudo nano /etc/apt/sources.list
打开后注释之前的源地址,用下面的源替换
清华的源:deb https://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
源地址主要下载三方软件使用。
四。
改完之后
sudo apt-get update
sudo apt-get upgrade
执行一把,时间挺长;