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.
Easy and simple guide to install dhclient command on Oracle Linux.