linux安装报错之:ifconfig command not found解决
问题描述:
用虚拟机VMware安装linux系统(镜像文件是从官网下载的CentOS-7.0-1406-x86_64-DVD.iso),
在安装完成之后,输入ifconfig命令报错:ifconfig command not found
解决思路:
1 确定是否是没有安装ifconfig,如果没有,添加上去
2 确定是否是没有添加到环境变量上,如果没有,添加上去
解决方法:
首先判断一下是不是缺少了ifconfig,它是在/sbin目录下的 [root@localhost ~]# cd /sbin
[root@localhost sbin]# ls 查看一下是否有 ifconfig 没有 ifconfig 的话安装 net-tools package [root@localhost sbin]# sudo yum install net-tools
参考:https://blog.csdn.net/dandelion_drq/article/details/53503487
当然,如果指定目录下已经存在ifconfig,也有可能是其它问题导致,比如环境变量没有添加:
原本使用ifconfig 可以使用,今天是怎么了,可能安装软件修改了,百度~~ [oracle@localhost /]$ ifconfig
提示:“bash: ifconfig: command not found”
于是我切换到root用户下
[root@localhost /]$ ifconfig
依然提示:“bash: ifconfig: command not found”
分析问题
.whereis ifconfig 看一下这个命令在哪个目录下
.echo $PATH 看一下该目录是否在路经下,注意lunux下是完全区分大小写的,所以不要忽略这点
.执行命令,需要指定路径或者把目录加入PATH中
.于是可以这样访问
方法一:[root@localhost sbin]$ /sbin/ifconfig 就可以出现使用了
方法二:[root@localhost sbin]$ export PATH=$PATH:/sbin ,这样设置后,下次就可以直接访问了,免处第一种的麻烦,如:
[root@localhost /]$ ifconfig
方法三:修改/etc/profile文件,注释掉if语句即可
把下面的if语句注释掉:
# Path manipulation
if [ "$EUID" = "" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
fi
修改为
# Path manipulation
# if [ "$EUID" = "" ]; then
pathmunge /sbin
pathmunge /usr/sbin
pathmunge /usr/local/sbin
#fi
注:不光是ifconfig命令出现“bash: ifconfig: command not found”,原因非root用户的path中没有/sbin/ifconfig ,其它的命令也可以出现这种情况,解决的方法是一样的。
--------------------- 本文来自 xu1314 的CSDN 博客 ,全文地址请点击:https://blog.csdn.net/xu1314/article/details/6951762?utm_source=copy
linux安装报错之:ifconfig command not found解决的更多相关文章
- linux 安装报错:pkg-config not found
linux 安装报错:pkg-config not found 使用编译安装时,在执行./configure时报如下错误: ... ... checking for pkg-config... no ...
- python安装locustio报错error: invalid command 'bdist_wheel'的解决方法
locust--scalable user load testing tool writen in Python(是用python写的.规模化.可扩展的测试性能的工具) 安装locustio需要的环境 ...
- php编译安装 报错 make ***[libphp5.la] Error 1解决方法
报错信息: /usr/bin/ld: cannot find -lltdl collect2: ld returned 1 exit status make: *** [libphp5.la] Err ...
- U盘安装Linux安装报错及解决方案
导读 从网上看到了<Linux就该这么学>后,偏离软件行业多年的我下定决心回归!这篇文章是我这一个小白的亲身经历,希望能被采纳! 开始按照<Linux就该这么学>中所讲在自己的 ...
- linux下报错bash: service: command not found
在linux下操作的时候经常会遇到,bash: service: command not found这个错误,以前在网上找了,照着弄了,也没细看原因,今天又碰到这个问题,就顺便研究一下. 1.通常这种 ...
- eclipse在linux安装报错
JVM terminated. Exit code=127/usr/bin/java-Dosgi.requiredJavaVersion=1.8-Dosgi.instance.area.default ...
- python模块安装报错 :error: command 'gcc' failed with exit status 1
参考:http://blog.csdn.net/fenglifeng1987/article/details/38057193 解决方法 yum install gcc libffi-devel py ...
- rlwrap安装报错You need the GNU readline 解决方法
首先大家肯定知道rlwrap是干什么的? 在linux以及unix中,sqlplus的上下左右.回退无法使用,会出现乱码情况.而rlwrap这个软件就是用来解决这个的. 这个错误曾经困扰我很久很久 ...
- python中使用pip安装报错:Fatal error in launcher... 解决方法
python安装了2和3版本在 cmd 中用pip报的错误为:Fatal error in launcher:Unable to create process using 这是因为你安装了python ...
随机推荐
- 批量判断网页是否NOT found
import java.net.HttpURLConnection;import java.net.URL; public class NetValible{ static String[] url ...
- gvim
[gvim] 1.gvim的配置文件在安装目录下,文件名为_vimrc. 2.通过以下命令选择配色方案:
- Cassandra读写性能测试
1. 测试目的 测试Cassandra集群读写TPS的极值,确定Cassandra读写性能. 2. 测试环境 2.1 硬件信息 CPU 8核 Intel(R) Xeon(R) CPU E5-2650 ...
- selenium+jenkins网页自动化测试的构建
jenkins+selenium可以做到对web自动化的持续集成. Jenkins的基本操作: 一.新建视图及job 新建视图: 新建job: 可以选择构建一个自由风格的软件项目或者复制已有的item ...
- Visual studio 2015/2017 opencv3.4 kineck2.0 osg realsense配置
----------------------------------------------包含目录-------------------------------------------------- ...
- HowTo: Xen 4.1.3 Windows 8 HVM domU with Intel HD4000 VGA Passthrough on Debian Wheezy
http://linux-bsd-sharing.blogspot.com/2012/10/howto-xen-413-windows-8-hvm-domu-with.html Update 05/0 ...
- 文件操作putc
putc是把一个字符写入到指定文件中,每写一个字符,文件指针自动加1. 我写了一个随机生成255字符到d:/456.txt的程序. int main() { FILE *p; int num[255] ...
- python 数据合并
1. 数据合并 前言 一.横向合并 1. 基本合并语句 2. 键值名不一样的合并 3. “两个数据列名字重复了”的合并 二.纵向堆叠 统计师的Python日记[第6天:数据合并] 前言 根据我的Pyt ...
- sklearn中的随机森林
阅读了Python的sklearn包中随机森林的代码实现,做了一些笔记. sklearn中的随机森林是基于RandomForestClassifier类实现的,它的原型是 class RandomFo ...
- 36 有n个整数,使其前面各数顺序向后移n个位置,最后m个数变成最前面的m个数
题目:有n个整数,使其前面各数顺序向后移n个位置,最后m个数变成最前面的m个数 public class _036ExchangeSite { public static void main(Stri ...