The Linux kernel is open source software and, consequently, its source code (millions of lines of C) is available.
Sometimes, it is important (and interesting) to compile either a specific kernel module (typically because of a bug correction) or to compile the whole kernel. Of course, it is technically possible to download the latest Linux kernel, compile it and install it on an enterprise Linux distribution like RHEL or CentOS but this is not recommended.
Instead, Red Hat and CentOS recommend to obtain the source code of the kernel which is already in use in those distributions, configure it, compile it and install the compiled kernel without removing the previous one(s).
When using CentOS (for example), the first step is to obtain the source code of the kernel and unpack it correctly.
Then, depending on user requirements, the system administrator can:
- either build one kernel module (e.g. to correct a bug) and use that corrected module in the current kernel
- or rebuild the whole kernel and install it without removing existing kernels.