03更换树莓派的更新源

2017-08-22 11:29:17

lsb-release -a #查看树莓派版本为Codename:stretch

pi@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.1 (stretch)
Release: 9.1
Codename: stretch


sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak #备份原先的源文件
sudo nano /etc/apt/sources.list #使用nano编辑器编辑新的源

pi@raspberrypi:~ $ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
pi@raspberrypi:~ $ sudo nano /etc/apt/sources.list

注释掉原有的官方源
添加新源

deb http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free
deb-src http://mirrors.aliyun.com/raspbian/raspbian/ stretch main contrib non-free
#deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ stretch main contrib non-free rpi

 

 

Ctrl+O保存,Ctrl+X退出 

保存并退出后,就可以测试新的源了。
posted @ 2018-09-07 09:46  新贵  阅读(163)  评论(0编辑  收藏  举报