Linux CentOS内核版本2.6升级为4.4

LinuxCentOSDocker大约 1965 字

安装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官网

阅读 847 · 发布于 2019-09-06

————        END        ————

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

昵称:
随便看看换一批