Now run the make menuconfig command to configure the Linux kernel. Once you execute the below command a pop up window appears with all the menus. Here you can enable or disable certain kernel features. If you unfamiliar with these menus, just hit ESC key to exit.

# cd /usr/src/linux-4.17.11/
# make menuconfig

Once your kernel configuration options are set, click on Save to save the configuration interface and exit from the menu.

Make Menuconfig

Save Kernel Configuration

Compile the Kernel in CentOS 7

Before starting kernel compilation, make sure your system has more than 25GB of free space on the file system. To confirm, you can check the file system free space using df command as shown.

# df -h

Now compile and install the kernel and modules using following commands (it may take several hours). The compilation process place files under /boot directory and also make a new kernel entry in your grub.conf file.

# make bzImage
# make modules
# make
# make install
# make modules_install

Once the compilation completes, reboot the system and verify newly installed Kernel.

# uname -sr

Verify Kernel Version

That’s it. I hope this article will be much helpful to you all. If you’re facing any problems or difficulties while compiling or installing kernel feel free to ask or post your questions using our comment form below.

I am Ravi Saive, creator of TecMint. A Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux. Follow Me: Twitter, Facebook and Google+

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

This article is too old and haven’t been updated a while, the latest Kernel is 4.15 and we are in process of updating this article with latest instructions for CentOS/RHEL based distributions. Till then stay tuned for more updates..

Thank you for this guide. I just tested this successfully on a CentOS 6.4 system with kernel 3.9.4.

Apart from the dependencies already mentioned in the article, on a freshly installed minimal CentOS 6.4 I also needed make and bc.

Note that “make menuconfig” allows you to select the already running kernel’s configuration file (resides in /boot/), and accepts the defaults for all options that were introduced between the old and the new version of the kernel, whereas “make oldconfig” automatically finds the configuration file in /boot/ and asks you questions for all the new configuration options.