Raspbian更新源

备份

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo cp /etc/apt/sources.list.d/raspi.list /etc/apt/sources.list.d/raspi.list.bak

树莓派官方认证源

http://www.raspbian.org/RaspbianMirrors

编辑文件

sudo vi /etc/apt/sources.list

将其他行注释#,然后将下面命令复制到 respi.list

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi

同样,编辑文件

sudo vi /etc/apt/sources.list.d/raspi.list

将其他行注释#,然后将下面命令复制到 respi.list

deb http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian// stretch main ui

最后执行 更新系统,更新软件包

sudo apt-get update && sudo apt-get upgrade -y

如出现“暂时不能解析域名”,在/etc/resolv.conf 文件下新一行输入即可。

sudo vi /etc/resolv.conf
nameserver 114.114.114.114

你可能感兴趣的:(树莓派)