Home MiscellaneousCompiling and installing new kernel in Redhat Linux

Compiling and installing new kernel in Redhat Linux

by Bella
Compiling and installing new kernel in Redhat Linux

This guide explains how to upgrade your Linux kernel from version 2.6.32 to 3.2.71 by compiling and installing it manually from source.

Step 1: Install Required Dependencies

Before compiling the kernel, install the necessary development tools and update the system packages.

yum install gcc ncurses ncurses-devel
yum update

These packages ensure your system has the required compiler and libraries for kernel compilation.

Step 2: Download Kernel Source

Navigate to the source directory and download the Linux kernel source code.

cd /usr/src/
wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.2.71.tar.xz

You can also download the latest kernel version from:
https://www.kernel.org/

Step 3: Extract Kernel Source

Extract the downloaded archive and move into the kernel directory.

tar xvfJ linux-3.2.71.tar.xz
cd linux-3.2.71

Step 4: Configure the Kernel

You can configure the kernel using an interactive menu or reuse the existing configuration.

Interactive Configuration

make menuconfig

Use Existing Configuration

If you want to reuse the current kernel configuration:

make oldconfig

This generates a .config file based on your existing setup.

If you like to configure your latest kernel with old configuration then simple type the below command.

1k

Step 5: Compile the Kernel

Start the compilation process. This may take 40–60 minutes depending on system performance.

make

Step 6: Install the Kernel

Once compilation completes successfully, install the kernel modules and files:

make modules_install install

This automatically:

  • Copies files to /boot
  • Updates GRUB bootloader entries

Step 7: Verify Installation

Check if the new kernel files are created in /boot:

ls /boot/ | grep 3.2.71

Expected files include:

  • vmlinuz-3.2.71
  • initramfs-3.2.71.img
  • System.map-3.2.71

Step 8: Verify GRUB Entry

After installation, GRUB configuration will include the new kernel:

title Red Hat Enterprise Linux Server (3.2.71)
kernel /vmlinuz-3.2.71
initrd /initramfs-3.2.71.imgtitle Red Hat Enterprise Linux (2.6.32-71.el6.x86_64)

The old kernel remains available as a fallback option.

Step 9: Boot into New Kernel

To boot once into the new kernel safely:

echo "savedefault --default=1 --once" | grub --batch

Then reboot the system:

shutdown -rf now

This ensures that if the new kernel fails, the system can revert to the previous stable kernel automatically.

Step 10: Verify Kernel Version

After reboot, confirm the running kernel version:

uname -r

Conclusion

You have successfully upgraded your Linux kernel from 2.6.32 to 3.2.71 by compiling from source. This process improves system performance, stability, and hardware support while maintaining a safe fallback to the older kernel.

If you require help, contact SupportPRO Server Admin

Facing issues?

Our technical support
engineers can solve it.

Contact Us today!
guy server checkup

You may also like

Leave a Comment