1. download source package url: http://www.kernel.org on the home page can see stable, longterm and other versions, General choose to download longterm version, because this version provides long-term support for stable version, so I choose 3.12.16. [root @ CentOS-BinaryDev ~] # Wgethttps: // www. ke
1. download the source code package
URL:Http://www.kernel.org
On the homepage, you can see stable and longterm versions. Generally, you can download longterm versions. this version is a stable version that provides long-term support. Therefore, I chose 3.12.16.
[Root @ CentOS-BinaryDev ~] # Wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.16.tar.xz
2. decompress and enter the Directory
[Root @ CentOS-BinaryDev ~] # Tar-xf linux-3.12.16.tar.xz
[Root @ CentOS-BinaryDev ~] # Cd linux-3.12.16
3. update the current system
[Root @ CentOS-BinaryDev ~] # Yum update
[Root @ CentOS-BinaryDev ~] # Yum upgrade
4. install the software packages required to compile the kernel
[Root @ CentOS-BinaryDev ~] # Yum groupinstall "Development Tools"
[Root @ CentOS-BinaryDev ~] # Yum install ncurses-devel
[Root @ CentOS-BinaryDev ~] # Yum install qt-devel
[Root @ CentOS-BinaryDev ~] # Yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel
5. view the current system kernel
[Root @ CentOS-BinaryDev ~] # Uname-r
2.6.32-358.11.1.el6.x86_64
6. copy the configuration file of the current system kernel to the current directory.
[Root @ CentOS-BinaryDev ~] # cp /boot/config-2.6.32-358.11.1.el6.x86_64 .config
7. use the current system kernel configuration and automatically accept the default settings for each new option
[Root @ CentOS-BinaryDev ~] # Sh-c 'Yes "" | make oldconfig'
8. Compile
[Root @ CentOS-BinaryDev ~] # Make bzImage
[Root @ CentOS-BinaryDev ~] # Make modules
[Root @ CentOS-BinaryDev ~] # Make modules_install
9. Installation
[Root @ CentOS-BinaryDev ~] # Make install
Ignore a small number of errors.
10. modify the Grub boot sequence
[Root @ CentOS-BinaryDev ~] # Vim/etc/grub. conf
Generally, the new kernel is located at the first one, so the default value is set to 0.
11. check the kernel version number after restart.
[Root @ CentOS-BinaryDev ~] # Uname-r
3.12.16
12. if the code fails, go to step 1 and clear the last compiled field before restarting.
[Root @ CentOS-BinaryDev ~] # Make mrproper