ifconfig: command not found on CentOS 7 minimal installation – how to solve ?

Posted by

When you have a CentOS minimal installation is possible that you need to install more packages manually in order to use the machine “normally“.

The command “ifconfig” is one of the commands that not come preinstalled on the minimal installation of CentOS 7 but here you have two options to get that information,

1. ipaddr

That command will show you the details of the network interface cards on the machine. There you can see the “ip address” and more details about networking.

[root@localhost ~]# ipaddr

If you don’t like that option, you can use the normal command “ifconfig” but first you need to install some packages to use it.

2. Install package

As mentioned before, the package “net-tools” help to manage some features of the machine related to networking. The command “ifconfig” is part of the tools installed with that package, check the following example to know how to install it ?

[root@localhost ~]# yum install net-tools
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.cedia.org.ec
* extras: mirror.cedia.org.ec
* updates: mirror.cedia.org.ec
Package net-tools-2.0-0.22.20131004git.el7.x86_64 already installed and latest version
Nothing to do
[root@localhost ~]#

In this example, the package was previously installed and does not need anything else,
Package net-tools-2.0-0.22.20131004git.el7.x86_64 already installed and latest version
Nothing to do
but if your machine does not have the package, just type “Y” for yes and wait until the process is done.

After that, repeat the command once again,

[root@localhost ~]# ifconfig

Finally, if you actually do not know if the package is already installed or not, just list the packages installed and search for the specific package, or do a grep for the specific package.

Example,

Entire packages list

[root@localhost ~]# rpm –qa

Specific package

[root@localhost ~]# rpm –qa | grep [packagename]
[root@localhost ~]# rpm –qa | grep net-tools

Enjoy.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s