您当前的位置:首页 > 智能家居 > 树莓派使用apt-get安装软件报错 网站首页 智能家居
树莓派使用apt-get安装软件报错
发布时间:2018-08-14 14:14:16编辑:阅读()
-
之前使用apt-get安装软件一切正常,今天突然连不上软件镜像。报如下错误:
Get:1 http://mirrors.zju.edu.cn/raspbian/raspbian stretch/main armhf busybox armhf 1:1.22.0-19 [374 kB]
Err:2 http://mirrors.opencas.cn/raspbian/raspbian stretch/main armhf udhcpd armhf 1:1.22.0-19
Cannot initiate the connection to mirrors.opencas.cn:80 (2001:cc0:2020:4075::211). - connect (101: Network is unreachable)
Fetched 374 kB in 4s (82.2 kB/s)
E: Failed to fetch http://mirrors.opencas.cn/raspbian/raspbian/pool/main/b/busybox/udhcpd_1.22.0-19_armhf.deb Cannot initiate the connection to mirrors.opencas.cn:80 (2001:cc0:2020:4075::211). - connect (101: Network is unreachable)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?其实是因为服务器在国外,有时候可能网络不好,导致超时或者异常,可以修改树莓派的安装源来解决这个问题
1、修改sources列表
nano /etc/apt/sources.list
把默认的源替换成新的,修改后如下
#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
deb http://mirrors.shu.edu.cn/raspbian/raspbian/ stretch main contrib non-free rpi2、更新源列表
执行如下命令应该不在报错
sudo apt-get update
关键字词:树莓派,apt-get,树莓派安装软件失败
上一篇:树莓派如何开启root用户
下一篇:开门既亮的感应灯自制方法教程