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作用相同

相关推荐
qetfw3 小时前
Debian OpenSSL CA 证书配置参考:根证书、服务证书与验证
linux·debian·ssl·openssl
qetfw3 天前
Debian OpenSSL 搭建 CA 证书服务:签发、吊销与客户端信任
linux·debian·openssl·ca
qetfw7 天前
Debian 使用 FTP 镜像源配置 APT 软件源
linux·debian·apt·ftp
XiangrongZ8 天前
debian中配置stm32的交叉编译环境
运维·stm32·debian
qetfw8 天前
Debian Apache2 执行 Shell CGI:动态时间页面配置与验证
linux·运维·debian
qetfw10 天前
Debian Apache2 实战:自定义站点目录、运行用户与 Basic Auth 认证
linux·运维·debian
qetfw11 天前
Debian 配置 AIDE 文件完整性检测:基线初始化、变更检查与数据库更新
linux·网络·数据库·debian
谜之锋23 天前
银河麒麟 Debian 系统离线deb包安装Mariadb 数据库指南
数据库·debian·mariadb
美丽的欣情1 个月前
RK3588 Debian 交叉编译环境搭建(Windows + VMware Debian + CMake)
运维·windows·debian