Install dhclient command on Oracle Linux

|
Last Updated:
|
|

This simple guide will show you how to install dhclient command on Oracle Linux. Have you installed Oracle Linux system and trying to configure automatic IP addresses via DHCP using dhclient command? Well, unlike the CentOS/RHEL/Rocky Linux systems, the dhclient command is not installed by default.

Install dhclient command on Oracle Linux

In our environment, we have Oracle Linux 9 installed on a VirtualBox. You can check the guide below on how to install Oracle Linux 9 on VirtualBox.

Install Oracle Linux 9 on VirtualBox

As already mentioned, dhclient command is not installed by default on Oracle Linux system.

So, first of all, what package provides the dhclient command? This can be checked using the command below;

sudo dnf provides dhclient

Sample output;

dhcp-client-12:4.4.2-15.b1.el9.x86_64 : Provides the ISC DHCP client daemon and dhclient-script
Repo        : @System
Matched from:
Provide    : dhclient = 12:4.4.2-15.b1.el9

dhcp-client-12:4.4.2-15.b1.el9.x86_64 : Provides the ISC DHCP client daemon and dhclient-script
Repo        : ol9_baseos_latest
Matched from:
Provide    : dhclient = 12:4.4.2-15.b1.el9

From the output above, you can see that dhclient command is provided by the package called dhcp-client.

You can install dhclient using the DNF/YUM package manager by

sudo yum install dhcp-client

Or

sudo dnf install dhcp-client

Or via the dhclient virtual package;

sudo dnf install dhclient

It is also possible to install automatically.

When you run;

sudo dhclient

If the command is not installed, the system will prompt you to install.


bash: dhclient: command not found...
Install package 'dhcp-client' to provide command 'dhclient'? [N/y] y


 * Waiting in queue... 
The following packages have to be installed:
 dhcp-client-12:4.4.2-15.b1.el9.x86_64	Provides the ISC DHCP client daemon and dhclient-script
 dhcp-common-12:4.4.2-15.b1.el9.noarch	Common files used by ISC dhcp client, server and relay agent
 ipcalc-1.0.0-5.el9.x86_64	IP network address calculator
Proceed with changes? [N/y] y


 * Waiting in queue... 
 * Waiting for authentication... 
 * Waiting in queue... 
 * Downloading packages... 
 * Requesting data... 
 * Testing changes... 
 * Installing packages... 

You can also check the version;

dhclient --version

You can then after installing dhclient command on Oracle Linux, use it to configure automatic interface IP address assignment.

For example, to assign all interfaces DHCP IP addresses, just run;

sudo dhclient

To configure automatic IP address assignment from DHCP server on a specific interface, e.g enp0s8;

sudo dhclient enp0s8

You can also release the DHCP addresses using either -r or -x option.

sudo dhclient [-r|-x]

Or

sudo dhclient [-r|-x] INTERFACE

And that is all on installing dhclient command on Oracle Linux.

Other Tutorials

Install Sysdig System Visibility Tool on Ubuntu 22.04

How to get byte count in a file in Linux

SUPPORT US VIA A VIRTUAL CUP OF COFFEE

We're passionate about sharing our knowledge and experiences with you through our blog. If you appreciate our efforts, consider buying us a virtual coffee. Your support keeps us motivated and enables us to continually improve, ensuring that we can provide you with the best content possible. Thank you for being a coffee-fueled champion of our work!

Photo of author
koromicha
I am the Co-founder of Kifarunix.com, Linux and the whole FOSS enthusiast, Linux System Admin and a Blue Teamer who loves to share technological tips and hacks with others as a way of sharing knowledge as: "In vain have you acquired knowledge if you have not imparted it to others".

1 thought on “Install dhclient command on Oracle Linux”

Leave a Comment