今天要在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命令的问题。通过更换阿里云的软件源并更新软件包列表,成功安装了net-tools包,进而能够正常使用ifconfig命令。

3788

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



