To install the kernel source code on a Red Hat Enterprise Linux (RHEL) or CentOS system, you can use the yum
command with the install
option.
Here is the basic syntax for installing the kernel source code on a RHEL or CentOS system:
sudo yum install kernel-devel
This will install the kernel source code and the necessary headers and tools required to build kernel modules.
If you want to install a specific version of the kernel source code, you can use the yum
command with the --showduplicates
option to list all available versions, and then specify the desired version using the --version
option.
For example, to install the kernel source code for the 3.10.0-1062.9.1.el7
kernel, you can use the following command:
sudo yum install kernel-devel --showduplicates --version 3.10.0-1062.9.1.el7
By using the yum
command with the install
option, you can easily install the kernel source code on your RHEL or CentOS system. It's always a good idea to carefully review the documentation and use the appropriate commands to install packages on your system. This will help ensure that the packages are installed correctly and that your system is properly configured.