The kernel is the core of the operating system, and runs the CPU, manages system memory, controls access to disk drives, and contains device drivers that enable you to interact with the system and use the hardware and peripherals attached to the computer.Naturally, kernel update appeals most system administrators who are responsible for wringing the most performance and benefit out of their existing hardware and software. In some cases, rebuilding the kernel(kernel upgrade or kernel update) is required in order to support new hardware that is not supported, or that is poorly supported, by your system’s existing kernel.
Why Should you upgrade/update
- Security Fixes
- Stability Improvements
- Updated Drivers
- New Kernel Functions
- Increased Speed
for kernel compile you need more memory and processor for faster compilation other wise it will take more time for compile.
i have following configuration
Check the current kernel of the system by using uname –r option.
Download latest stable kernel from www.kernel.org.Now the latest stable kernel is 4.7.6
curl -O https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.7.6.tar.xz
Then extract the kernel source by using tar –jxvf and copy to /usr/src as follows
tar -Jxvf linux-4.7.6.tar.xz cp -rf linux-4.7.6 /usr/src cd /usr/src/ ls
run the following command for GCC and other development tools
yum group install "Development Tools"
then install bc to run kernel compile
yum install bc
Then run the command make mrproper
then run following command
yum install ncurses-devel ncurses
Then run the command make menuconfig
just set as default if you want to modify you can modify and then save and exit
Now install the package openssl-devel package by using yum
yum install openssl-devel
Then run the command make it takes a moment please be patient and wait.
i have 8 cpu so i run
Then run the command make modules
make modules -j8
now install modules by using the command make modules_install.
make modules_install -j8
Now run the command make install
make install -j8
Following command can be used to list the kernels in centos 7
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
reboot the system by using following command
You can use grub2-set-default command to set default boot kernel, to set first kernel in grub2.cfg as default run and reboot.
here i have in second that why i run following command
then remove unused kernel
yum list kernel.* yum remove kernel-version number
i have run the following command as per my version
yum remove kernel-3.10.0-327.36.1.el7
run the following command
Remove Build Folder