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.
Check the current kernel of the system by using uname –r option.
[[email protected] ~]# uname -r 3.10.0-327.el7.x86_64
After you have determined the version of the kernel you are currently running, the next step is to obtain the latest version of the kernel source code.
Download latest stable kernel from www.kernel.org.Now the latest stable kernel is 4.5.3
At any given time, there are almost always two versions of the Linux kernel available, the stable and the unstable or development version. You can differentiate between the versions by looking at the kernel version numbers. The kernel version numbering system is easy to understand. Kernel versions are numbered using the format major.minor.patch, where major is the major version number, minor is the minor version number, and patch is the patch level. The major version number, currently 4, changes very infrequently and represents substantial or fundamental changes between kernel releases. The minor version number, 5 in the examples shown in the previous section, changes much more often as new features are added to the kernel, such as new file systems, as major subsystems undergo significant remodeling, as significant bugs are fixed, or as security patches are incorporated into the source code.
Update kernel of the CentOS to Latest stable Kernel
Download latest stable kernel 4.5.3 from www.kernel.org.
Then extract the kernel source by using tar –jxvf and copy to /usr/src as follows
[[email protected] ~]#tar -Jxvf linux-4.5.3.tar.xz [[email protected] ~]#cp -rf linux-4.5.3 /usr/src [[email protected] src]# ls debug kernels linux-4.5.3
Then change the directory to linux-4.5.3 by using cd command as follows
[[email protected] src]# cd linux-4.5.3
Then run the command make mrproper
[[email protected] linux-4.5.3 ]# make mrproper
Now install the packages nucrses and nucrses-devel by using yum as follows
[[email protected] linux-4.5.3 ]# yum install ncurses nucrses-devel
Then run the command make menuconfig
[[email protected] linux-4.5.3 ]# make menuconfig
save the configuration exit from it.
Now install the package openssl-devel package by using yum
[[email protected] linux-4.5.3 ]# yum install openssl-devel
Then run the command make it takes a moment please be patient and wait.
[[email protected] linux-4.5.3 ]# make
The sample ouput is like
Then run the command make modules
[[email protected] linux-4.5.3]# make modules CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh Building modules, stage 2. MODPOST 2175 modules
now install modules by using the command make modules_install.
[[email protected] linux-4.5.3]# make modules_install
The sample ouput is like follows
INSTALL /lib/firmware/radeon/RV620_me.bin INSTALL /lib/firmware/radeon/RV635_pfp.bin INSTALL /lib/firmware/radeon/RV635_me.bin INSTALL /lib/firmware/radeon/RV670_pfp.bin INSTALL /lib/firmware/radeon/RV710_me.bin INSTALL /lib/firmware/av7110/bootcode.bin INSTALL /lib/firmware/ttusb-budget/dspbootcode.bin INSTALL /lib/firmware/korg/k1212.dsp INSTALL /lib/firmware/ess/maestro3_assp_kernel.fw INSTALL /lib/firmware/ess/maestro3_assp_minisrc.fw INSTALL /lib/firmware/tigon/tg3.bin INSTALL /lib/firmware/tigon/tg3_tso.bin INSTALL /lib/firmware/tigon/tg3_tso5.bin INSTALL /lib/firmware/emi26/loader.fw INSTALL /lib/firmware/emi26/firmware.fw INSTALL /lib/firmware/emi26/bitstream.fw INSTALL /lib/firmware/mts_edge.fw INSTALL /lib/firmware/edgeport/boot.fw INSTALL /lib/firmware/edgeport/boot2.fw INSTALL /lib/firmware/edgeport/down.fw INSTALL /lib/firmware/edgeport/down2.fw INSTALL /lib/firmware/edgeport/down3.bin INSTALL /lib/firmware/whiteheat_loader.fw INSTALL /lib/firmware/whiteheat.fw INSTALL /lib/firmware/keyspan_pda/keyspan_pda.fw INSTALL /lib/firmware/keyspan_pda/xircom_pgs.fw DEPMOD 4.5.3 [[email protected] linux-4.5.3]#
Now run the command make install
[[email protected] linux-4.5.3]# make install sh ./arch/x86/boot/install.sh 4.5.3 arch/x86/boot/bzImage \ System.map "/boot" [[email protected] linux-4.5.3]#
and Then reboot the system
[[email protected] linux-4.5.3]# reboot [[email protected] linux-4.5.3]#
The GRUB screen as like
Now enjoy the new kernel version 4.5.3