/**PageBeginHtml Block Begin **/ /***自定义返回顶部小火箭***/ /*生成博客目录的JS 开始*/ /*生成博客目录的JS 结束*/

【Ubuntu 无法使用ifconfig解决办法】

* 博客文章部分截图及内容来自于学习的书本及相应培训课程以及网络其他博客,仅做学习讨论之用,不做商业用途。
* 如有侵权,马上联系我,我立马删除对应链接。
* @author Alan
* @Email no008@foxmail.com

【Ubuntu 无法使用ifconfig解决办法】

 
Ubuntu 无法使用ifconfig解决办法
在使用ubuntu时需要使用ifconfig命令提示

Command 'ifconfig' not found, did you mean:

  command 'iconfig' from deb ipmiutil (3.1.5-1)
   command 'pifconfig' from deb python3-ethtool (0.14-3build1)
   command 'fconfig' from deb redboot-tools (0.7build3)
Try: sudo apt install <deb name>

在网上找了很多方法说尝试

sudo apt-get update
apt-get install net-tools

和更换镜像源还是不行。
最后发现在 Ubuntu 20.04 中,ifconfig 命令已被弃用并替换为 ip 命令。
可以使用以下命令来查看网络接口和 IP 地址:

ip addr show

该命令将显示当前系统上所有网络接口的详细信息,包括每个接口的 IP 地址、MAC 地址和其他网络配置。如果只想查看特定接口的信息,可以在命令后面加上接口名,如下所示:

ip addr show eth0

其中 eth0 是要查看信息的接口名称。

最近通过更换清华镜像源后成功安装了ifconfig;
具体步骤如下

[安装ifconfig解决方法]:
1、在 /etc/apt/sources.list 末尾增加如下源
sudo gedit /etc/apt/sources.list 【修改sources.list文件需要使用sudo赋予权限】
将如下copy,粘贴至sources.list

deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse

注意: 这里的“focal”是ubuntu20.04的版本代号。
     ubuntu18.04的版本代号是“bionic”
      可以在终端通过 lsb_release -a 进行查看 即Codename所对应的值
      2、然后更新

sudo apt-get update

最后安装

sudo apt install net-tools
————————————————

                            版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
                        
原文链接:https://blog.csdn.net/qq_40945712/article/details/129550385

posted @   一品堂.技术学习笔记  阅读(46)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?
历史上的今天:
2022-01-12 更快的Maven来了,我的天,速度提升了8倍!
2022-01-12 云鹏在美团八年工作总结
2018-01-12 Oracle存储过程记录异常
2018-01-12 ORACL内部异常:
点击右上角即可分享
微信分享提示