赞
踩
在安装Docker时,发现操作系统内核版本过低。因为Docker对操作系统的内核是有要求的,所以,在此记录一下内核升级过程。
提前准备好:CentOS 6.10 ISO镜像文件或者Oracle Etnterpres Linux 6.10)ISO
系统要求:
Docker目前只能运行在64位平台上,并且要求内核版本不低于3.10,实际上内核越新越好,过低的内核版本容易造成功能不稳定。
用户可以通过如下命令检查自己的内核版本详细信息:
三个命令都可以查看,详情如下图:
配置yum源:
创建文件上传目录以及挂载目录,上传iso文件到/root/linuxiso目录下.
进入yum源目录,备份原yum源配置:
创建新的本地yum源:
更新rpm包:
升级内核:
到/mnt/linuxiso/Packages,找到kernel-uek-4.1.12-124.16.4.el6uek.x86_64.rpm
内核包所依赖的包:
安装内核操作:
[root@test Packages]# yum install -y kernel-uek-4.1.12-124.16.4.el6uek.x86_64.rpm Loaded plugins: security Setting up Install Process Examining kernel-uek-4.1.12-124.16.4.el6uek.x86_64.rpm: kernel-uek-4.1.12-124.16.4.el6uek.x86_64 Marking kernel-uek-4.1.12-124.16.4.el6uek.x86_64.rpm as an update to kernel-uek-2.6.39-200.24.1.el6uek.x86_64 Resolving Dependencies --> Running transaction check ---> Package kernel-uek.x86_64 0:4.1.12-124.16.4.el6uek will be installed --> Processing Conflict: kernel-uek-4.1.12-124.16.4.el6uek.x86_64 conflicts dracut < 004-303.0.3 --> Restarting Dependency Resolution with new changes. --> Running transaction check ---> Package dracut.noarch 0:004-283.0.1.el6 will be updated --> Processing Dependency: dracut = 004-283.0.1.el6 for package: dracut-kernel-004-283.0.1.el6.noarch ---> Package dracut.noarch 0:004-411.0.1.el6 will be an update --> Running transaction check ---> Package dracut-kernel.noarch 0:004-283.0.1.el6 will be updated ---> Package dracut-kernel.noarch 0:004-411.0.1.el6 will be an update --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================== Installing: kernel-uek x86_64 4.1.12-124.16.4.el6uek /kernel-uek-4.1.12-124.16.4.el6uek.x86_64 145 M Updating: dracut noarch 004-411.0.1.el6 ol6_610 129 k Updating for dependencies: dracut-kernel noarch 004-411.0.1.el6 ol6_610 28 k Transaction Summary =============================================================================================================================================================================================== Install 1 Package(s) Upgrade 2 Package(s) Total size: 145 M Total download size: 157 k Downloading Packages: ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Total 1.7 MB/s | 157 kB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Updating : dracut-004-411.0.1.el6.noarch 1/5 Updating : dracut-kernel-004-411.0.1.el6.noarch 2/5 Installing : kernel-uek-4.1.12-124.16.4.el6uek.x86_64 3/5 Cleanup : dracut-kernel-004-283.0.1.el6.noarch 4/5 Cleanup : dracut-004-283.0.1.el6.noarch 5/5 Verifying : dracut-004-411.0.1.el6.noarch 1/5 Verifying : kernel-uek-4.1.12-124.16.4.el6uek.x86_64 2/5 Verifying : dracut-kernel-004-411.0.1.el6.noarch 3/5 Verifying : dracut-004-283.0.1.el6.noarch 4/5 Verifying : dracut-kernel-004-283.0.1.el6.noarch 5/5 Installed: kernel-uek.x86_64 0:4.1.12-124.16.4.el6uek Updated: dracut.noarch 0:004-411.0.1.el6 Dependency Updated: dracut-kernel.noarch 0:004-411.0.1.el6 Complete!
修改默认启动内核:
下图中,0代表启动的时候,使用第1个版本的内核。
# grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,0) # kernel /vmlinuz-version ro root=/dev/mapper/vg00-lvroot # initrd /initrd-[generic-]version.img #boot=/dev/sda default=0 --默认是1,这里修改为0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title CentOS 6 (4.1.12-124.16.4.el6uek.x86_64) --这里修改为升级后的内核版本号 root (hd0,0) kernel /vmlinuz-2.6.32-696.el6.x86_64 ro root=/dev/mapper/vg00-lvroot rd_NO_LUKS LANG=en_US.UTF-8 rd_LVM_LV=vg00/lvroot rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet initrd /initramfs-2.6.32-696.el6.x86_64.img
最后,重启操作系统:
[root@test ~]# reboot #重启服务器 [root@test ~]# uname -r #查看内核是否升级成功。
如需iso文件,请留言。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。