本文樹莓派爲3B+,系統爲Raspbian(stretch)
Version:June 2018
Release date:2018-06-27
Kernel version:4.9
查看樹莓派的版本
查看樹莓派的版本:
lsb_release -a
➜ ~ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
修改source.list
根據版本修改相應的源
上面的輸出說明源爲stretch
,查找到相應的源,進行替換。
替換源的文件一般在/etc/apt/
文件夾下。
修改source.list
文件的默認的內容爲
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-free rpi
將上面的源註釋掉,添加以下內容
deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi
並把原來的東西註釋掉.
修改raspi.list
文件
還需要修改/etc/apt/sources.list.d
文件夾下的raspi.list
文件的默認的內容爲
deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui
將上面的源註釋掉,添加以下內容
deb http://mirrors.ustc.edu.cn/archive.raspberrypi.org/ stretch main ui
更新完成後,更新軟件源
sudo apt-get update -y
sudo apt-get dist-upgrade -y
也可以不用加-y
reference
[1] https://blog.csdn.net/qq_38632611/article/details/79710689