樹莓派換APT源

一.出錯情景

今天把去年的樹莓派拿出來用,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 

執行一把,時間挺長;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章