-
2022-02-15 11:58:39
问题重现:
最小化安装系统发现没有ifconfig命令
[root@itlaoxin-81 ~]# ifconfig -bash: ifconfig: 未找到命令
问题分析
一般发现没有命令我们想到第一件事就是安装ifconfig命令,此时可能不太清楚要安装哪个包,所以我们使用命令查找ifconfig是由哪个包安装的。
执行下面的命令:
[root@itlaoxin-81 ~]# yum search ifconfig 已加载插件:fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.aliyun.com * extras: mirrors.cqu.edu.cn * updates: mirrors.aliyun.com ========================= 匹配:ifconfig ========================= net-tools.x86_64 : Basic networking tools
可以看到我们只需要安装net-tools.x86_64 这个包即可
问题解决
- 安装net-tools包
[root@itlaoxin-81 ~]# yum install net-tools
- 查看安装完后的效果,是否可以使用ifconfig命令
[root@itlaoxin-81 ~]# ifconfig |grep inet |awk 'NR==1{print $2}' 192.168.3.81
可以看到ifconfig命令可以使用了。
总结
本小节重点命令为yum search
可以使用这个命令查看命令是由哪个包产生的。更多相关内容 -
CentOS7最小化安装以后没有ifconfig这个命令的解决方案
2021-05-15 10:19:35前几天我最小化安装了一下CentOS7,进入系统发现没有ifconfig这个网络配置工作,又想急着上网,那怎么办呀。下面是我给出的解决方法:1、用光驱配置yum源,安装net-tools这个软件包(或者用rpm这个命令)。1.1、把...前几天我最小化安装了一下CentOS7,进入系统发现没有ifconfig这个网络配置工作,又想急着上网,那怎么办呀。下面是我给出的解决方法:
1、用光驱配置yum源,安装net-tools这个软件包(或者用rpm这个命令)。
1.1、把CentOS默认的yum源除(CentOS-Media.repo)都移动到一个指定的目录,我是在yum源配置文件存放目中建了一个叫repo的子目录,以下是具体操作:
[root@bogon ~]# cd /etc/yum.repos.d/
[root@bogon yum.repos.d]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentO S-Media.repo CentOS-Sources.repo CentOS-Vault.repo
[root@bogon yum.repos.d]# mkdir repo
[root@bogon yum.repos.d]# ls
CentOS-Base.repo CentOS-Debuginfo.repo CentOS-Media.repo CentOS-Vault.repo
CentOS-CR.repo CentOS-fasttrack.repo CentOS-Sources.repo repo
[root@bogon yum.repos.d]# mv *.repo repo/
[root@bogon yum.repos.d]# ls
repo
[root@bogon yum.repos.d]# cd repo/
[root@bogon repo]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentO S-Media.repo CentOS-Sources.repo CentOS-Vault.repo
[root@bogon repo]# mv CentOS-Media.repo ../
[root@bogon repo]# ls
CentOS-Base.repo CentOS-CR.repo CentOS-Debuginfo.repo CentOS-fasttrack.repo CentO S-Sources.repo CentOS-Vault.repo
[root@bogon repo]# cd ..
[root@bogon yum.repos.d]# ls
CentOS-Media.repo repo
1.2、挂载光驱配置yum源的具体操作步骤:
[root@bogon yum.repos.d]# mount /dev/sr0 /media/
mount: /dev/sr0 is write-protected, mounting read-only
#以上是挂载光驱的命令和操作步骤
[root@bogon yum.repos.d]# cat CentOS-Media.repo
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///media/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#以上光驱yum源的配置文档
[root@bogon yum.repos.d]# yum list | wc -l
3776
#用yum list查看测试yum源是否存在问题
1.3、用yum安装net-tools工具包
[root@bogon yum.repos.d]# yum install net-tools -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Resolving Dependencies
--> Running transaction check
---> Package net-tools.x86_64 0:2.0-0.17.20131004git.el7 will be installed
--> Finished Dependency Resolution
…………
Running transaction
Installing : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
Verifying : net-tools-2.0-0.17.20131004git.el7.x86_64 1/1
Installed:
net-tools.x86_64 0:2.0-0.17.20131004git.el7
Complete!
1.4、测试ifconfig命令
[root@bogon yum.repos.d]# ifconfig
eno16777736: flags=4163 mtu 1500
inet 192.168.1.131 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::20c:29ff:fe2d:c130 prefixlen 64 scopeid 0x20
ether 00:0c:29:2d:c1:30 txqueuelen 1000 (Ethernet)
RX packets 53366 bytes 3890372 (3.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47832 bytes 22949340 (21.8 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 58 bytes 5088 (4.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 58 bytes 5088 (4.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
2、在linux中除了ifconfig这个命令可以配置IP地址之外还有一个命令就是ip了(本人用的是这种方法)。
[root@bogon yum.repos.d]# ip addr l eno16777736
2: eno16777736: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:0c:29:2d:c1:30 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.131/24 brd 192.168.1.255 scope global eno16777736
valid_lft forever preferred_lft forever
inet6 fe80::20c:29ff:fe2d:c130/64 scope link
valid_lft forever preferred_lft forever
[root@bogon yum.repos.d]# ip addr add 192.168.1.131/24 dev eno16777736
ip这个命令和博大精深不是一两句话就可以说明的,在以后网络学习的时候我会给大家进行详细认真的讲解,再给大家提一下关于网卡,在CentOS7以后默认的网卡类型标识符为eno16777736,在以前的系统为ethN。
-
Linux最小化安装vim ifconfig安装配置
2020-04-01 19:30:15##Linux最小化安装vim ifconfig安装配置 1、最小化安装vim相关配置 最小化安装需要配置vim,否则命令无法使用 (1)查看vim安装包命令 rpm -qa|grep vim (2)安装vim命令 yun install -y vim* (3)查看安装是否成功 ...##Linux最小化安装vim ifconfig安装配置
1、最小化安装vim相关配置
最小化安装需要配置vim,否则命令无法使用
(1)查看vim安装包命令
rpm -qa|grep vim
(2)安装vim命令
yun install -y vim*
(3)查看安装是否成功
rpm -qa|grep vim
2、配置ifconfig命令
(1)查看ifconfig命令
yum search ifconfig
(2)安装
yum install -y net-tools*
(3)测试
-
CentOS7最小化安装,无法使用ifconfig命令解决方案_MQ
2021-11-30 17:51:21CentOS7最小化安装,无法使用ifconfig命令解决方案_MQ 一、问题记录: CentOS7最小化安装系统后,会发现执行ifconfig命令,提示命令未找到 二、解决方案 1、使用ip addr命令查看一下网卡配置信息是否分配了IP,...CentOS7最小化安装,无法使用ifconfig命令解决方案_MQ
一、问题记录:
CentOS7最小化安装系统后,会发现执行ifconfig命令,提示命令未找到
二、解决方案
1、使用ip addr命令查看一下网卡配置信息是否分配了IP,结果显示网络信息未分配
ip addr
2、进入网卡配置文件的目录,查看网卡配置文件信息,并修改配置文件;将ONBOOT=no修改为ONBOOT=yes然后wq保存并退出。
cd /etc/sysconfig/network-scripts/
vi ifcfg-对应的网卡
3、重启网卡服务
systemctl restart network
4、重启网卡服务完成后,我们再次执行命令 ip addr 查看是否分配到IP地址,这里我们可以看到已经分配到IP地址。
ip addr
5、接下来需要安装net-tools工具包
yum install net-tools
6、安装完成后我们再次执行ifconfig即可正常查看到我们的网卡ip信息啦
ifconfig
到此结束
-
Centos7最小化安装后ifconfig命令找不到的问题
2022-03-24 23:00:07在最小化安装centos7后使用ifconfig命令,发送找不到命令的最佳解决方法! -
CentOS8 最小化安装后找不到 ifconfig 命令
2021-11-05 17:53:14CentOS最小化安装后找不到ifconfig命令 1. 使用 ifconfig 命令找不到 2. 使用 yum search ifconfig 收一下 3. 检测不到,使用这个命令安装一下 yum install net-tools.x86_64 4.安装后狂按 Y 5.输入ifconfig ... -
linux最小化安装ifconfig、netstat等
2019-03-22 13:46:16一、如果是刚安装的最小化linux,需要修改网络配置文件 1.修改网卡配置文件ifcfg-ens33 ,ens33是网卡接口名字 2.使用命令vi修改ifcfg-ens33(vi命令详见 vi使用详解) 3.安装netstat、ifconfig等小工具 ... -
centos7 最小化安装没有ifconfig 命令
2017-11-07 16:30:00centos6和7 还是有些变化的,最小化安装后我们经常用的查看ip信息命令:ifconfig 就没有此命令! 查看ip: ip addr 使用ifconfig命令: 1 2 3 这里“provides”或者“whatprovides”开关用于找出某个包提供... -
Linux最小化安装后一般需要安装的命令的rpm包合集
2019-06-20 21:01:581、ifconfig命令 yum install net-tools -y 2、vim编辑器 yum -y install vim 3、tab补全键 安装epel 源 yum -y install epel-release 加快yun速度 yum -y install yum-plugin-fastestmirror 安装bash... -
Linux最小化安装后一般需要安装的命令所需RPM包
2019-12-20 14:21:281. ifconfig yum -y install net-tools 2. vim文本编辑器 yum -y install vim Tab命令补全 安装epel源 yum -y install epel-release 加快yum速度 yum -y install yum-plugin-fastestmirror 安装bash-completion... -
最小化安装linux内无ifconfig服务
2020-04-10 11:55:021.最小化安装的linux内有的不自动安装net-tools工具所以无ifconfig服务 [root@localhost ~]# ifconfig -bash: ifconfig: 未找到命令 2.这个时候需要安装net-tools工具 (yum下载需要提前设置或者在虚拟机直接挂接... -
Linux最小化安装 minimal(迷你模板机)
2021-05-16 10:35:21Linux最小化安装minimal=====================配置网卡、ip地址、连接xshellifconfigip linkifconfig eth0 up ======此时ip link 中显示state为upcd /etc/sysconfig/network-scripts/vi ifcfg-eth0===========以下... -
Centos 7 安装 ifconfig命令
2022-02-12 17:05:14Centos 7在最小化安装时,系统默认没有安装 ifconfig 命令 如果直接运行 ifconfig 命令,会提示 -bash: ifconfig :command not found 运行 yum -y isntall ifconfig 命令时,结果显示: NO package ifconfig ... -
Linux篇.Centos7中没有安装ifconfig命令的解决方法
2019-05-21 11:53:151.首先,ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端,运行ifconfig命令就会出错。... -
CentOS最小模式下没有ifconfig命令的解决方法
2021-12-16 11:01:32安装CentOS系统时,如果选择了最小安装模式,系统安装好后,是没有ifconfig命令的,这时只需要配置好yum,然后安装net-tools这个包就可以了。命令如下: yum -y install net-tools 安装完后,就可以使用ifconfig... -
Linux 最小化安装后IP的配置
2021-05-13 12:24:21linux最小化安装后没有ifconfig这个命令:yum install net-tools.x86_64这样就安装了ifconfig命令。使用ifconfig看看IP:可以看到并没有自动分配IP,我的VM是DHCP,网卡使用net连接: 首先,使用Linux自带网络工具... -
linux rpm找不到命令_Linux下安装ifconfig命令(Centos找不到ifconfig命令)
2020-11-10 18:24:56很多时候,最小化安装Linux ,会发现很多基础的命令都没有 。这个时候,只能自己安装了 。比如,想查看刚安装的Linux服务器 ,IP地址是多少 。很多同学,会用ifconfig 查看 。如果找不到此命令 ,怎么安装呢 ?直接... -
CentOS7最小化安装后,ifconfig命令无法使用command not found
2021-01-27 14:57:21CentOS7最小化安装后,ifconfig命令无法使用。command not found 问题描述: 准备在虚拟机装CentOS7系统来当作本地服务器部署项目,最小化安装后,在配置网络时ifconfig运行报错 -bash: ifconfig : command not ... -
【Linux】 Centos7 没有ifconfig命令
2022-03-01 19:39:42最近想装着k8s玩玩,本地用vmware装了Centos 6.7系统,执行 yum install -y ...也不想接着用centos 6了,干脆重装了Centos 7系统选择的是最小化模式,发现没有ifconfig命令,无奈,只有凭经验先把ip改好。 编辑该... -
Red Hat Enterprise Linux 7.7 使用最小化安装后,怎么安装桌面的解决方法
2021-05-13 12:14:54准备工具:虚拟机安装教程百度即可,安装时有两个重点:1、安装操作系统时选择稍后安装操作系统2、安装时默认最小化安装即可,无需调整获取ip:1、执行ip addr 命令,查看网卡名称(ifconfig被放弃了,没有安装,... -
linux 最小化安装了centos7.6 无网络
2022-03-29 11:31:33ifconfig命令没有安装,也找不到安装包,后执行命令 cd /etc/sysconfig/network-scripts到目录下, ls命令查看,找到类似 ifcfg-ens33的文件,vi ifcfg-ens33打开文件,是普通模式,按下i进入插入编辑操作,把... -
CentOS7.0最小化安装(Mini镜像)ifconfig命令无效问题排查
2021-08-05 15:57:23一、命令存在,环境变量原因导致: 排查流程: 1、查看是ifconfig命令是否存在 # ls /sbin/ifconfig 如果存在,那么: 2、查看环境变量设置: ...二、最小化安装命令不存在原因导致: 1、查看是ifconfig命令是否存. -
linux虚拟机搭建后找不到ifconfig命令
2022-03-29 09:43:07对于最小化安装CentOs7的没有安装ifconfig,我们安装ifconfig输入:yum install net-tools,就可以了 -
Centos7.9最小化安装,配置yum ifconfig ssh
2022-04-29 21:49:18Centos7.9最小化安装,配置yum ifconfig ssh -
Centos 7 最小安装后关键命令找不到 ifconfig等
2021-05-11 01:40:30Centos 7 最小安装后需要做以下操作:1. 打开网络编辑: /etc/sysconfig/network-scripts/ifcfg-en*, 一般为第一个文件!把其中的BOOTPROTO设为 dhcpONBOOT设为yes修改如下示例:[root@localhost sysconfig]# cat /etc/... -
最小化安装缺少ifconfig、route等命令
2018-05-08 12:23:19yum install net-tools -
Redhat7没有安装ifconfig命令的解决方法
2021-05-13 13:13:23ifconfig命令是设置或显示网络接口的程序,可以显示出我们机器的网卡信息,可是有些时候最小化安装Redhat等Linux发行版的时候会默认不安装ifconfig等命令,这时候你进入终端,运行ifconfig命令就会出错。这是我们... -
Linux安装(CentOS7安装)与最小化安装配置(全过程)
2022-04-06 16:36:52Linux安装(CentOS7安装)与最小化安装配置(全过程) -
安装ifconfig命令
2018-09-05 02:29:091.centos7没有安装ifconfig命令的解决方法 ifconfig命令是设置或显示网络接口的程序,可以...可是有些时候最小化安装CentOS等Linux发行版的时候会默认不安装ifconfig等命令, 这时候你进入终端,运行ifconfig命令... -
Centos7最小安装完成后,ifconfig命令用不了。
2021-05-11 19:57:53目录首先检查一下本机的相关服务是否启动1. cd /etc/sysconfig/network-scripts/2. sudo vi ifcfg- 按tab键补齐3. 按 i 键进入编辑4.... 使用yum provides ifconfig 来查看那个包提供了ifconfig的功能