CentOS升级并设置默认启动

简单介绍

在服务器编译Docker Image的时候出现了异常,异常信息为内核版本过低,开始我使用uname -r看了一下内核版本,2.6…,是够低的。百度上查了很多,不过没成功过,我们直接上官网吧。

Quick Start

Import the public key:

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

Detailed info on the GPG key used by the ELRepo Project can be found on https://www.elrepo.org/tiki/key
If you have a system with Secure Boot enabled, please see the SecureBootKey page for more information.

To install ELRepo for RHEL-7, SL-7 or CentOS-7:

1
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

To make use of our mirror system, please also install yum-plugin-fastestmirror.

To install ELRepo for RHEL-6, SL-6 or CentOS-6:

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

To make use of our mirror system, please also install yum-plugin-fastestmirror.

查看CentOS版本

1
cat /etc/issue

修改默认启动项

修改grub.conf中的default=0, 也就是你默认启动的版本,之后重新启动就OK啦。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@localhost] vim /etc/grub.conf

# 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/VolGroup-lv_root

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

#boot=/dev/sda

default=0

timeout=5

参考原文

More info: http://elrepo.org

Fiveplus wechat
扫一扫上方二维码,关注微信公众号:阿五编程
如果这篇文章对你有所帮助,请点击下方的打赏按钮。