您的位置:首页 > 运维架构 > Linux

CentOS 下yum快速升级内核

2015-07-15 13:29 531 查看
1、导入public key

1

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2、安装ELRepo到CentOS 6.6中

1

rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm
3、安装长期支持版本

1

yum --enablerepo=elrepo-kernel install kernel-lt -y

4、编辑grub.conf文件,修改Grub引导顺序

1

vim /etc/grub.conf

确认刚刚安装的内核的位置,然后将default修改一下。

Vim

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

# 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/vg_have-lv_root
# initrd /initrd-[generic-]version.img

#boot=/dev/xvda
default=0

timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz

hiddenmenu
title CentOS (3.10.63-1.el6.elrepo.x86_64)

root (hd0,0)
kernel /vmlinuz-3.10.63-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_have-lv_root rd_LVM_LV=vg_have/lv_root rd_LVM_LV=vg_have/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=hvc0 crashkernel=auto rhgb quiet

initrd /initramfs-3.10.63-1.el6.elrepo.x86_64.img
title CentOS (2.6.32-504.3.3.el6.x86_64)

root (hd0,0)
kernel /vmlinuz-2.6.32-504.3.3.el6.x86_64 ro root=/dev/mapper/vg_have-lv_root rd_LVM_LV=vg_have/lv_root rd_LVM_LV=vg_have/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=hvc0 crashkernel=auto rhgb quiet

initrd /initramfs-2.6.32-504.3.3.el6.x86_64.img
title CentOS (2.6.32-358.6.1.el6.x86_64)

root (hd0,0)
kernel /vmlinuz-2.6.32-358.6.1.el6.x86_64 ro root=/dev/mapper/vg_have-lv_root rd_LVM_LV=vg_have/lv_root rd_LVM_LV=vg_have/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=hvc0 crashkernel=auto rhgb quiet

initrd /initramfs-2.6.32-358.6.1.el6.x86_64.img
title CentOS (2.6.32-220.el6.x86_64)

root (hd0,0)
kernel /vmlinuz-2.6.32-220.el6.x86_64 ro root=/dev/mapper/vg_have-lv_root rd_LVM_LV=vg_have/lv_root rd_LVM_LV=vg_have/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=hvc0 crashkernel=auto rhgb quiet

initrd /initramfs-2.6.32-220.el6.x86_64.img
title CentOS (2.6.32-131.0.15.el6.x86_64)

root (hd0,0)
kernel /vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root=/dev/mapper/vg_have-lv_root rd_LVM_LV=vg_have/lv_root rd_LVM_LV=vg_have/lv_swap rd_NO_LUKS rd_NO_MD rd_NO_DM LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us console=hvc0 crashkernel=auto rhgb quiet

initrd /initramfs-2.6.32-131.0.15.el6.x86_64.img

新装的内核位置为0,所以讲default修改为0,保存退出重启。

5、检查内核

1

2

[root@MyServer ~]#
uname -r
3.10.63-1.el6.elrepo.x86_64

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: