本文转自:http://www.511yj.com/centos-yum-kernel.html

今天想在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-6.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-6.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

国外网速较慢,耐心等待....返回:

........
* base: mirror.bit.edu.cn
* elrepo: repos.lax-noc.com
* elrepo-kernel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.sina.cn
* updates: mirror.bit.edu.cn
base | 3.7 kB 00:00
elrepo | 2.9 kB 00:00
elrepo/primary_db | 716 kB 00:45
https://mirrors.tuna.tsinghua.edu.cn/elrepo/kernel/el6/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.tuna.tsinghua.edu.cn'"
Trying other mirror.
elrepo-kernel | 2.9 kB 00:00
elrepo-kernel/primary_db | 19 kB 00:00
extras | 3.4 kB 00:00
extras/primary_db | 37 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 2.0 MB 00:01
Setting up Install Process
Resolving Dependencies
--> Running transaction check
.....
Total download size: 33 M
Installed size: 154 M
Downloading Packages:
http://repos.lax-noc.com/elrepo/kernel/el6/x86_64/RPMS/kernel-lt-3.10.103-1.el6.elrepo.x86_64.rpm: [Errno 12] Timeout on http://repos.lax-noc.com/elrepo/kernel/el6/x86_64/RPMS/kernel-lt-3.10.103-1.el6.elrepo.x86_64.rpm: (28, 'Operation too slow. Less than 1 bytes/sec transfered the last 30 seconds')
Trying other mirror.
kernel-lt-3.10.103-1.el6.elrepo.x86_64.rpm | 33 MB 68:27
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : kernel-lt-3.10.103-1.el6.elrepo.x86_64 1/1
Verifying : kernel-lt-3.10.103-1.el6.elrepo.x86_64 1/1 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

升级成功!

centos6.4或者6.5使用yum的elrepo源升级内核的更多相关文章

  1. 烂泥:centos6 yum方式升级内核

    本文由ilanniweb提供友情赞助,首发于烂泥行天下 想要获得更多的文章,可以关注我的微信ilanniweb 最近没有时间好久没有写文章了,今天由于需要安装docker学习虚拟容器的知识,需要升级O ...

  2. centos6 yum方式升级内核【转】

    最近没有时间好久没有写文章了,今天由于需要安装docker学习虚拟容器的知识,需要升级OS的内核.目前我这边使用的OS是centos6.5,内核是2.6版本的,如下: cat /etc/issue u ...

  3. centos6.5linux安装docker之升级内核

    一.运行docker Linux内核版本需要在3.8以上,针对centos6.5 内核为2.6的系统需要先升级内核.不然会特别卡 在yum的ELRepo源中,有mainline(4.5).long-t ...

  4. Centos6升级内核方法

    docker需要内核在3.0以上,如果centos6上需要安装docker的话需要先将内核进行升级 工具/原料   Centos6.5_x64 方法/步骤     操作系统为centos6.5,内核为 ...

  5. centos6.5yum方式升级内核

    升级内核需要使用elrepo的yum源,在安装yum源之前还需要我们导入elrepo的key,如下:rpm -import https://www.elrepo.org/RPM-GPG-KEY-elr ...

  6. Linux/CentOS配置:使用yum update更新时不升级内核的方法

    RedHat/CentOS/Fedora使用 yum update 更新时,默认会升级内核.但有些服务器硬件(特别是组装的机器)在升级内核后,新的内核可能会认不出某些硬件,要重新安装驱动,很麻烦.所以 ...

  7. 因kernel too old 而 centos6.8 升级内核

    因为docker运行centos 的时候,报错了,错误为kernel too old .我看了一下是因为os的内核不行了,需要升级下内核. 查看默认版本: uname -r 忘记截图了,内核大概是2. ...

  8. centos6.4搭建基于ftp的yum源让本地局域网服务器使用

    1. 挂载centos6.4 DVD镜像[root@centos64 ~]# mount /dev/cdrom /mnt 2. 安装vsftp软件,启动vsftpd服务,拷贝centos6.4 DVD ...

  9. yum使用本地源

    cache: [k2e喜]: 注意它的发音: 不是: keik the attribute could not be removed from the cache. 不能从缓存删除属性. YUM对服务 ...

随机推荐

  1. SQL Union作用

    动态构造一个SQL语句然后执行,构造动态语句的查询语句如下 SELECT REPLACE(WMSYS.WM_CONCAT(STR),',',' UNION ') FROM (SELECT 'SELEC ...

  2. LoadRunner脚本关联动态数据的最简单方法

    为什么要关联动态数据呢?举个例子,在对我们平台的工作流性能测试时, 在待办任务里面选择一条记录执行发送操作,LoadRunner VuGen会详细记录下来流程发送操作的细节,但在回放脚本的时候会有问题 ...

  3. 文本挖掘之文本聚类(MapReduce)

    刘 勇  Email:lyssym@sina.com 简介 针对大数量的文本数据,采用单线程处理时,一方面消耗较长处理时间,另一方面对大量数据的I/O操作也会消耗较长处理时间,同时对内存空间的消耗也是 ...

  4. 开源大数据技术专场(下午):Databircks、Intel、阿里、梨视频的技术实践

    摘要: 本论坛第一次聚集阿里Hadoop.Spark.Hbase.Jtorm各领域的技术专家,讲述Hadoop生态的过去现在未来及阿里在Hadoop大生态领域的实践与探索. 开源大数据技术专场下午场在 ...

  5. 搭建前端vue环境,安装vue-cli遇到Please try running this command again as root/Administrator的解决方案

    最近在搭前端环境,装完node.js之后,准备安装vue工程的初始化工具时(npm install -g vue-cli),遇到这个坑: 大体的意思就是权限问题,导致/usr/local/lib/no ...

  6. hdu1695 容斥原理 莫比乌斯反演

    给定两个数b,d,问[1,b]和[1,d]区间上有多少对互质的数.(x,y)和(y,x)算一个. 对于[1,b]部分,用欧拉函数直接求.对于大于b的部分,求n在[1,b]上有多少个互质的数,用容斥原理 ...

  7. 奇怪的php问题

    <?php echo 999999999999 % 2; ?> 上面的结果居然是-1,不可思议. 999999999999 % 2

  8. POJ 1836 Alignment (双向DP)

    Alignment Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 10804   Accepted: 3464 Descri ...

  9. python学习笔记013——模块中的私有属性

    1 私有属性的使用方式 在python中,没有类似private之类的关键字来声明私有方法或属性.若要声明其私有属性,语法规则为: 属性前加双下划线,属性后不加(双)下划线,如将属性name私有化,则 ...

  10. 简单的WPS二次开发脚本

    详细信息见:http://bbs.wps.cn/thread-22427301-1-1.html 下载:WPS2013专业版:WPS2013Pro_normal.exe 调用脚本(xl.vbs)内容如 ...