升级centos系统内核

本文详细介绍了如何在CentOS 6.5系统上升级内核至3.x版本,通过使用elrepo软件源安装kernel-lt或kernel-ml,以及修改grub配置以启用新内核的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天想在centos6.5安装docker,在网上查了说centos6.5需要64位的,内核需要升级到3.x以上(centos6.5本来是2.6),终于看到一篇文章是可以的,于是记录下来。

了解一下elrepo
elrepo是CentOS十分有用的稳定的软件源,与其他软件源不一样的是,这个第三方源主要是提供硬件驱动、内核更新方面的支持,如显卡、无线网卡、内核等等,现在已经支持centos7.x+,更新较快。

1、查看centos版本
[root@localhost ~]# cat /etc/centos-release
CentOS release 6.4 (Final)
2、查看内核
[root@localhost ~]# uname -r
2.6.32-358.el6.x86_64
3、首先你要做的就是导入public key
[root@localhost ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
4、然后安装ELRepo到CentOS-6.x中
注意:
elrepo-release-6-6.el6.elrepo.noarch.rpm这是针对centos6.0+版本的,网上的很多的文章都是错误的-6-5
1、安装 ELRepo for RHEL-6, SL-6 or CentOS-6:

rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
2、安装 ELRepo for RHEL-7, SL-7 or CentOS-7:

rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm (external link)
3、安装 ELRepo for RHEL-5, SL-5 or CentOS-5:

rpm -Uvh http://www.elrepo.org/elrepo-release-5-5.el5.elrepo.noarch.rpm (external link)
执行安装!

[root@localhost ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
返回:

Retrieving http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
Preparing… ########################################### [100%]
1:elrepo-release ########################################### [100%]
5、安装kernel-lt(lt=long-term)
[root@localhost ~]# yum --enablerepo=elrepo-kernel install kernel-lt -y
国外网速较慢,耐心等待…返回:

Installed:
kernel-lt.x86_64 0:3.10.103-1.el6.elrepo

Complete!
You have new mail in /var/spool/mail/root

或者安装kernel-ml(ml=mainline)

yum --enablerepo=elrepo-kernel install kernel-ml -y
二者任选其一!

6、编辑grub.conf文件,修改Grub引导顺序
vim /etc/grub.conf
按 i 把 default=1修改为 default=0,按esc 键,输入 :wq保存退出。

grub.conf generated by anaconda

Note that you do not have to rerun grub after making changes to this file

NOTICE: You do not have a /boot partition. This means that

all kernel and initrd paths are relative to /, eg.

root (hd0,0)

kernel /boot/vmlinuz-version ro root=/dev/sda1

initrd /boot/initrd-[generic-]version.img

#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/boot/grub/splash.xpm.gz
hiddenmenu
title CentOS (3.10.28-1.el6.elrepo.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-3.10.28-1.el6.elrepo.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8
rd_NO_LVM rd_NO_DM rhgb quiet
initrd /boot/initramfs-3.10.28-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-431.3.1.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-431.3.1.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=en_US.UTF-8 r
d_NO_LVM rd_NO_DM rhgb quiet
initrd /boot/initramfs-2.6.32-431.3.1.el6.x86_64.img
title CentOS (2.6.32-431.el6.x86_64)
root (hd0,0)
kernel /boot/vmlinuz-2.6.32-431.el6.x86_64 ro root=UUID=0a05411f-16f2-4d69-beb0-2db4cefd3613 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us rd_NO_MD crashkernel=auto LANG=zh_CN.UTF-8 rd_NO
_LVM rd_NO_DM rhgb quiet
initrd /boot/initramfs-2.6.32-431.el6.x86_64.img
注意:

确认刚安装好的内核在哪个位置,然后设置default值(从0开始),一般新安装的内核在第一个位置,所以设置default=0。

7、重启centos
[root@localhost ~]# reboot
8、重新查看内核
[root@localhost ~]# uname -r
3.10.103-1.el6.elrepo.x86_64
升级成功!


作者:jackcheng1117
来源:优快云
原文:https://blog.youkuaiyun.com/jackcheng1117/article/details/80952418
版权声明:本文为博主原创文章,转载请附上博文链接!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值