修改树莓派3B+的软件源-Raspbian(stretch)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/idealcitier/article/details/83017896

本文树莓派为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

猜你喜欢

转载自blog.csdn.net/idealcitier/article/details/83017896