今天要在linux中执行ifconfig命令,命令无效,然后安装网络包,执行 sudo apt-get update和sudo apt install net-tools,报如下错误:unable to locate package net-tools,可以确定自己的源sources.list有问题,但是从网上找了很多的源,一直解决不了问题,最终找到下面的源解决了问题。
ubuntu版本:17.04
进入源:sudo vi sources.list,将下列内容替换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
sources.list替换完后,重新执行sudo apt-get update和sudo apt install net-tools,然后就可以执行ifconfig了。完美解决!!!
在Ubuntu 17.04系统中,执行ifconfig命令失败,尝试通过sudo apt-get update和sudo apt install net-tools安装网络工具包时遇到错误:unable to locate package net-tools。问题根源在于sources.list配置不正确。解决方案是将sources.list替换为阿里云的镜像源,具体包括trusty的main、multiverse、restricted、universe、backports、proposed、security和updates等源。替换后重新运行更新和安装命令,成功执行ifconfig命令,问题得到解决。
1684

被折叠的 条评论
为什么被折叠?



