Debian系统终端输入ifconfig报错

报错

bash: ifconfig: command not found

原因

Debian 上默认不安装 ifconfig 软件包。这是因为 ifconfig 已被弃用,取而代之的是新的 ip 命令。该 ip 命令现在负责修改或显示路由、网络设备、接口和隧道

如果仍然想使用旧的 ifconfig 命令,则必须显式安装它。

解决方案

安装net-tools套件

cpp 复制代码
sudo apt install net-tools

可能遇到的问题

用户没有权限

可能的一种解决方案:Linux下 <用户名> is not in the sudoers file-CSDN博客

安装之后可以使用命令

cpp 复制代码
sudo ifconfig

使用iproute2套件

参考链接:https://blog.csdn.net/yimaoya/article/details/125341754

cpp 复制代码
ip addr

该命令和ifconfig作用相同

相关推荐
木子欢儿1 天前
在 Debian 12 上安装多个版本的 php(7.3、7.4、8.1、8.2)
运维·开发语言·debian·php
無法複制2 天前
debian安装Postgresql-14.x
运维·postgresql·debian
liulilittle6 天前
OPENPPP2静态隧道UDP中断问题排查与解决
网络·网络协议·ubuntu·udp·debian·信息与通信·通信
liulilittle6 天前
Debian/Ubuntu 18.04 上安装 GLIBC 2.28 (2026)
linux·运维·服务器·开发语言·c++·ubuntu·debian
csdn_life1810 天前
# Debian 10 升级到 Debian 13 指南
运维·debian·php
k7Cx7e10 天前
Debian安装 curl 时提示插入 DVD 光盘
运维·windows·debian
k7Cx7e11 天前
Debian执行ssh root@localhost 提示认证失败
运维·debian·ssh
欧云服务器24 天前
怎么让脚本命令可以同时在centos、debian、ubuntu执行?
ubuntu·centos·debian
~远在太平洋~24 天前
Debian系统如何删除多余的kernel
linux·网络·debian
~远在太平洋~24 天前
debian系统已安装python3.12却无法执行python命令
chrome·python·debian