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

本文树莓派为3B+,系统为Raspbian(stretch)
Version:June 2018
Release date:2018-06-27
Kernel version:4.9


推荐使用清华源

https://mirror.tuna.tsinghua.edu.cn/help/raspbian/


查看树莓派的版本

查看树莓派的版本:
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

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值