Linux CentOS 内核版本 2.6 升级为 4.4

Linux CentOS Docker About 1,974 words

前提

安装Docker1.7.1之后版本的前置条件是Linux内核版本最低为3.10

查看 Centos 版本

cat /etc/centos-release

输出:

CentOS release 6.10 (Final)

查看内核版本

uname -r

输出:2.6版本

2.6.32-754.el6.x86_64

升级步骤

1. 导入 public key

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

如果报错:

curl: (35) SSL connect error
error: https://www.elrepo.org/RPM-GPG-KEY-elrepo.org: import read failed(2).

升级nss

yum update nss

2. 安装 ELRepo 到 Centos6.X 中

截至发文前最新版 ELRepo 最新版为6.9,可在官网中选择适合Centos版本的ELRepo版本下载。

rpm -Uvh http://www.elrepo.org/elrepo-release-6-9.el6.elrepo.noarch.rpm

3. 安装 kernel-lt(long term support) 长期支持版本

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

4. 修改引导文件 grub.conf 的引导顺序

vim /etc/grub.conf

defalut=1修改为default=0,保存退出。

# 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/vg_zbj-lv_root
#          initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=1 #此处修改为0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS (4.4.190-1.el6.elrepo.x86_64)
        root (hd0,0)
        kernel /vmlinuz-4.4.190-1.el6.elrepo.x86_64 ro root=/dev/mapper/vg_zbj-lv_root rd_NO_LUKS rd_LVM_LV=vg_zbj/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_zbj/lv_swap rd_NO_DM rhgb quiet
        initrd /initramfs-4.4.190-1.el6.elrepo.x86_64.img
title CentOS 6 (2.6.32-754.el6.x86_64)
        root (hd0,0)
        kernel /vmlinuz-2.6.32-754.el6.x86_64 ro root=/dev/mapper/vg_zbj-lv_root rd_NO_LUKS rd_LVM_LV=vg_zbj/lv_root LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto  KEYBOARDTYPE=pc KEYTABLE=us rd_LVM_LV=vg_zbj/lv_swap rd_NO_DM rhgb quiet
        initrd /initramfs-2.6.32-754.el6.x86_64.img

5. 重启机器

reboot

6. 检查是否更新成功

uname -r

参考

ELRepo官网

Views: 5,191 · Posted: 2019-09-06

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓


Today On History
Browsing Refresh