今天在配置树莓派静态IP中发现ifconfig命令不可用,错误如下:
查阅后发现,此错误为Linux未安装网络包,
在执行
sudo apt-get update
后仍未解决,在尝试执行后
sudo apt install net-tools
显示错误:
最终在一位大佬处找到了解决方案,原文:解决unable to locate package net-tools
对自己的源sources.list进行修改,
进入源:sudo vi sources.list,替换当中的源,再重新执行安装网络包的命令,问题成功解决!
deb http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main multiverse restricted universe
效果:
成功执行ifconfig命令: