Environment: System hardware: vmwarevsphere (CPU: 2*4 core, memory 2G) system version: Linuxcentos2.6.32-431. el6.x86 _ 64 (Centos-6.5-x86_64-minimal.iso) upgrade kernel version: longterm: 3.12.17 upgrade steps: 1. virtual System Installation
Environment:
System hardware: vmware vsphere (CPU: 2*4 cores, 2 GB memory)
Linux centos 2.6.32-431. el6.x86 _ 64 (Centos-6.5-x86_64-minimal.iso)
Upgrade kernel: longterm: 3.12.17
Upgrade procedure:
1. Virtual System Installation
Mininal installation is required (205 packages). the specific steps are omitted.
2. check the original system kernel version and upgrade the update package.
2.1 update package
[Root @ centos ~] # Yum update
[Root @ centos ~] # Yum upgrade
2.2 view the system kernel version
[Root @ centos ~] # Uname-
Linux centos 2.6.32-431. el6.x86 _ 64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[Root @ centos ~] # Cat/etc/redhat-release
CentOS release 6.5 (Final)
3. download and install the toolkit required for compiling the environment
[Root @ centos ~] # Yum install vim wget
[Root @ centos ~] # Yum install gcc-c ++ xz
[Root @ centos ~] # Yum install bc
[Root @ centos ~] # Yum install ncurses-devel
[Root @ centos ~] # Yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel
[Root @ centos ~] # Yum install qt-devel # if the X environment is installed (not installed currently)
4. download the kernel package
4.1 Directory
[Root @ centos ~] # Cd/usr/local/src/
4.2 Download the kernel package. The current version is 3.12.17.
[Root @ centos ~] # Wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.12.17.tar.xz
5. Compile the kernel
5.1 unpack and run the kernel source code directory
[Root @ centos ~] # Tar-vxf linux-3.12.17.tar.xz
[Root @ centos ~] # Cd linux-3.12.17
* **/Usr/local/src/linux-3.12.17 this directory when compiling the directory, the compilation process, the operation must be in this directory
5.2 Select the modules required for compiling the kernel from the menu
[Root @ centos ~] # Make menuconfig
Open the menu and save it by default. And exit
After saving, the. config file is automatically generated in the current directory.
After making menuconfig is executed, modify/usr/src/linux-2.6.35.4/. config
Set # CONFIG_SYSFS_DEPRECATED_V2 is not set
If it is commented out by default, change it to y. Change to CONFIG_SYSFS_DEPRECATED_V2 = y.
5.3 check the current version and compile it with the original compilation configuration
[Root @ centos ~] # Uname-r
2.6.32-431. el6.x86 _ 64
5.4 copy the original configuration file to the compilation Directory (use the old matching file as the new matching template as needed)
[Root @ centos ~] # Cp/boot/config-2.6.32-431.11.2.el6.x86_64. config
Indicates whether to overwrite. enter Y.
[Root @ centos ~] # Sudo sh-c 'Yes "" | make oldconfig'
Generate a new configuration file using the original configuration file. the default answer is YES.
5.5 compile the kernel (it takes about 30-40 minutes)
[Root @ centos ~] # Make
5.6 install the kernel
[Root @ centos ~] # Make modules_install install
Upon completion, the system will prompt cocould not find module vmware_balloon, which is related to the virtual machine (ignore it)
6. change the kernel used when the system is started.
[Root @ centos ~] # Vim/boot/grub/menu. lst
Modify default = 0. after the instance is started, it is started as the first option by default (3.12.17 kernel)
Save and exit
7. restart the system
[Root @ centos ~] # Shutdown-r now
8. confirm the current kernel version
[Root @ centos ~] # Uname-r
Linux centos 3.12.17 #1 SMP Fri Apr 11 03:32:42 CST 2014 x86_64 x86_64 x86_64 GNU/Linux
The kernel is 3.12.17, indicating that the kernel is successfully upgraded.
9. if the compilation fails, clear it and re-compile it.
[Root @ centos ~] # Cd/usr/local/src/linux-3.12.17
[Root @ centos ~] # Make mrproper # After the installation is completed or an error occurs during the installation process, you can clear the last compiled site
[Root @ centos ~] # Make clean
10. if the update is successful, you can delete the source code directory.
[Root @ centos ~] # Rm-rf/usr/local/src/linux-3.12.17
11. delete the original kernel
11.1 view the current kernel version
[Root @ centos ~] # Rpm-q kernel
Show the following versions
Kernel-2.6.32-431.el6.x86_64
Kernel-2.6.32-431.11.2.el6.x86_64
11.2 delete the original kernel
[Root @ centos ~] # Yum remove kernel-2.6.32-431.el6.x86_64 # remove this version of kernel and the boot menu will no longer show this kernel
[Root @ centos ~] # Yum remove kernel-2.6.32-431.11.2.el6.x86_64
After deletion, check the boot menu and you will find that this kernel is missing.
[Root @ centos ~] # Cat/boot/grub/menu. lst