CentOS_7升级系统内核
最近,在虚拟机中安装docker成功之后,尝试运行docker run hello-world时出现以下错误:
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
1b930d010525: Pull complete
Digest: sha256:2557e3c07ed1e38f26e389462d03ed943586f744621577a99efb77324b0fe535
Status: Downloaded newer image for hello-world:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:: starting container process caused "process_linux.go:293: copying bootstrap data to pipe caused \"write init-p: broken pipe\"": unknown.
查资料得知,这是CentOS内核系统与docker版本不匹配所导致的问题,下面介绍一下如何升级系统内核。
升级系统版本
首先,查看当前系统版本
$ uname -r
3.10.-.el7.x86_64
然后进行升级
$ yum update
# 之后重启虚拟机
$ reboot
# 查看系统内核
$ uname -r
3.10.-.el7.x86_64
# 内核并未升级,升级的其实是系统版本
# 因为 CentOS 为了安全和稳定并不会把系统内核升级到最新的版本,所以 yum update 命令只会升级系统版本和更新软件
$ cat /etc/redhat-release
CentOS Linux release 7.6. (Core)
升级内核版本
升级内核
$ rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
$ rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
上述命令为启用elrepo仓库,我们可以使用以下命令列出可用的系统内核相关包:
$ yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
之后,就可以安装最新的稳定内核:
$ yum --enablerepo=elrepo-kernel install kernel-ml
重启机器,并选择最新安装的内核(第一个)
进入系统之后,查看内核版本uname -r
设置GRUB默认的内核版本
启动系统时,系统默认选择之前的版本,所以我们需要设置一下GRUB
$ vi /etc/default/grub GRUB_TIMEOUT=
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
重新创建内核配置
$ grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.0.-.el7.elrepo.x86_64
Found initrd image: /boot/initramfs-5.0.-.el7.elrepo.x86_64.img
Found linux image: /boot/vmlinuz-3.10.-.el7.x86_64
Found initrd image: /boot/initramfs-3.10.-.el7.x86_64.img
Found linux image: /boot/vmlinuz--rescue-16053a12b3234d688858493442d3b11e
Found initrd image: /boot/initramfs--rescue-16053a12b3234d688858493442d3b11e.img
done
重启,不进行选择内核操作,验证更新后的内核为默认内核
$ uname -r
5.0.-.el7.elrepo.x86_64
删除旧版本内核(可选)
查看当前全部内核
$ rpm -qa | grep kernel
kernel-tools-3.10.-.el7.x86_64
kernel-ml-5.0.-.el7.elrepo.x86_64
kernel-tools-libs-3.10.-.el7.x86_64
kernel-3.10.-.el7.x86_64
使用yum remove删除旧版本内核
yum remove kernel-tools-3.10.-.el7.x86_64 kernel-tools-libs-3.10.-.el7.x86_64 kernel-3.10.-.el7.x86_64
重启之后,发现没有其他内核可以选择。
CentOS_7升级系统内核的更多相关文章
- centos6升级系统内核
1.升级系统内核查看内核版本: uname -r 2.6.32-573.8.1.el6.x86_64 导入elrepo的key: rpm --import https://www.elrepo.org ...
- centos6安装docker,先升级系统内核
安装docker,其他的源可能导致你的内核和docker的版本不一致,需要将系统内核升级至3.x 查看当前系统版本 cat /etc/issue 查看当前内核版本 uname -r #uname -a ...
- centos7升级系统内核
1)升级 方法一: rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh http://www.elrepo.or ...
- CentOS 6.9安装docker之前升级系统内核版本
问题描述:安装docker,官方文档要求Linux kernel至少3.8以上,且docker只能运行在64位的系统中(这个很重要,搞了个i386的系统升级了半天没成功) 升级步骤: 1.因位安装服务 ...
- CentOS6下用yum升级系统内核版本至最新
首先当你决定升级内核时,要想清楚为什么升级内核,因为升级内核会带来很多麻烦.所以这种事情能避免就避免 导入 Public Key rpm --import https://www.elrepo.org ...
- CentOS7升级系统内核至4.4.xx版本
CentOS7.x系统自带的3.10.x内核存在一些Bugs,导致运行的Docker.kubernetes不稳定,建议升级内核,容器使用的坑会少很多 下载内核源 rpm -Uvh http://www ...
- Centos 下面升级系统内核(转)
1.导入public key 1 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org 2.安装ELRepo到CentOS 6. ...
- linux 升级系统内核linux-4.10版本
http://blog.csdn.net/steven_liwen/article/details/68487241
- centos7.5升级系统内核版本
1.yum update curl nss 2.yum install wget 3.rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.or ...
随机推荐
- php设计模式--简单介绍
鉴于最近有几个小伙伴总问一些设计模式相关的东西,本人借鉴了一些东西,准备将常见的几种php的设计模式总结整理出来. 平时我们用到的设计模式很多,建议大家多多读一些php开源框架,当深入的阅读了一些ph ...
- iOS---------显示和隐藏状态栏的网络活动标志
//在向服务端发送请求状态栏显示网络活动标志: [[UIApplication sharedApplication] setNetworkActivityIndicatorVisible:YES]; ...
- 通过百度地图API--获取全国地图的经纬度
因为要做一个前端画图需要经纬度,一个个的查询过麻烦,最终弄出这个,以备后查! import threading , time import requests from decimal import D ...
- [spring boot] Table 'yhm.hibernate_sequence' doesn't exist
在使用该注解时:@GeneratedValue要注意的几点: @GeneratedValue注解的strategy属性提供四种值: -AUTO主键由程序控制, 是默认选项 ,不设置就是这个 -IDEN ...
- java反射(java.lang.reflect)---java.lang.reflect.Modifier中状态码
1. 详情请看jvm(虚拟机)规范 java.lang.reflect.Modifier public static final int ABSTRACT 1024 public static fin ...
- Failed to initialize component [org.apache.catalina.webresources.JarResource
去本地仓库里删除掉对应出错的jar包,然后回到pom里面加个空行 让他重新下载(最好把maven仓库全部都删了 重新下载一次 ) 先备份 在复制回来 完美解决
- #019 还未搞明白的C语言问题
吐槽一下作业系统 自己电脑上跑的好好地到他这里就给我算错了.... 是我的问题还是系统的问题?????摸不着头脑 总分 12 从键盘任意输入某班30个学生的成绩(成绩类型为整型),保存到数组中,并输出 ...
- 给Integer对象加锁的错误方式
package com.thread.test; public class BadLockOnInteger implements Runnable { public static Integer i ...
- centos7下 svn的配置
安装svn yum install subversion 查看安装版本 svnserve --version 创建svn版本库目录 mkdir -p /root/svn/test 创建svn版本库 s ...
- Taro文件上传:Blob Url下载Blob对象本身并通过接口上传到服务器
最近项目的文件上传遇到一个问题,就是Taro的chooseImage传给回调的是一个Blob对象,一般来说,上传控件都会导出Data Url,而Taro给了一个Blob Url,问题在于,我直接令im ...