This paper is applicable to CentOS 6.4, CentOS 6.5, and is also suitable for other Linux distributions. 1. Prepare for Work 1.1 download source package
There are two versions of the Linux kernel: the stable version and the development version, and the Linux kernel version number consists of 3 digits: rxy r: Major version x: Minor version number, even for stable versions; Y: Revision number, indicating the number of changes
To http://www.kernel.org home page, you can see stable, longterm and other versions, longterm is more stable than the stable version, a long time to update, so I choose 3.10.28,
wget Https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.10.28.tar.xz
1.2 Decompression
TAR-XF LINUX-3.10.28.TAR.XZ
1.3 Update the current system
sudo yum update
sudo yum upgrade
1.4 Package required to install the build kernel
sudo yum groupinstall "Development Tools" # at one breath install all the tools required at compile time
sudo yum install ncurses-devel #This must be done to make * config this directive is Be carried out with certainty.
sudo yum install qt-devel #If you don't have X Environment, this one can be used without
sudo yum install hmaccalc zlib-devel binutils-devel elfutils-libelf -devel #create CentOS-6 kernel needs them
2 configuration File 2.1 View current system kernel
Uname-r
2.6.32-358.11.1.el6.x86_64
2.2 Copy the current system's configuration file to the current directory
cp / boot / config-2.6.32-358.11.1.el6.x86_64. config
2.3 Use the old kernel configuration and automatically accept the default settings for each new option
Sh-c 'Yes' | Make Oldconfig'
Make oldconfig reads the. Config file in the current directory, the option that is not found in the. Config file prompts the user to fill it out, and then backs up the. Config file to. Config.old and generates a new. Config file for reference http: // Stackoverflow.com/questions/4178526/what-does-make-oldconfig-do-exactly-linux-kernel-makefile 3 Compilation
sudo make-j8 bzimage #Generate kernel file
sudo make-j8 modules #Compile modules
sudo make-j8 modules_install #Compile and install modules
To strictly follow this order to compile, can not be merged into a sentence, sudo make-j8 bzimage modules Modules_install.
-J number is the number of threads, used to speed up the compilation speed, the general experience is how much g memory, fill in that number, such as 8G memory, then-j8. 4 Installation
sudo make install
If there is a ERROR: modinfo: could not find module XXX, the number is negligible and can be ignored. 5 Modify GRUB Boot order
After the installation is complete, you need to modify the grub boot sequence so that the newly installed kernel is the default kernel.
Edit the grub.conf file,
sudo vim / etc / grub.conf
Count the location of the newly installed kernel, start at 0, and then set default to that number, and generally the newly installed kernel is in the first position, so set default = 0. 6 reboot
sudo reboot
After restarting, look at the current kernel version number,
Uname-r
3.10.28
Success. 7 If it fails, cycle again
If you fail to start again, clean up the last compiled scene
Make Mrproper #Clean the scene of the last compilation
Then go to step 2nd and start again. Reference to upgrade the kernel on CentOS CentOS 6.4 upgrade to 3.x kernel CentOS Linux upgrade kernel steps and methods