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 ...
随机推荐
- css隐藏滚动条
xhtml中隐藏滚动条在用ie6浏览有框架的xhtml页面的时候,默认会水平和垂直滚动条会一起出现,这是ie6的一个bug,在firefox上是正常的,出现的原因是其对XHTML 1.0 transi ...
- vue项目利用apicloud打包成apk过程
最近公司要求我们用apicloud做一个app,正好利用这个机会学习下app的制作过程~ 页面的开发过程跟我们平时开发一样,利用vue把页面全部完成,最后进行npm run build将项目打包. 接 ...
- 轻量级应用程序Dynamics 365 App for Outlook介绍
摘要: 本人微信和易信公众号: 微软动态CRM专家罗勇 ,回复273或者20180625可方便获取本文,同时可以在第一间得到我发布的最新的博文信息,follow me!我的网站是 www.luoyon ...
- GeoServer安装配置
需安装文件 1.安装jdk 2.安装GeoServer: (1).在安装GeoServer前,需要安装java运行环境,点击文件夹内的jdk安装文件,选择jdk安装路径进行安装:直到安装完成. (2) ...
- Python开发爬虫之静态网页抓取篇:爬取“豆瓣电影 Top 250”电影数据
所谓静态页面是指纯粹的HTML格式的页面,这样的页面在浏览器中展示的内容都在HTML源码中. 目标:爬取豆瓣电影TOP250的所有电影名称,网址为:https://movie.douban.com/t ...
- selenium2 run in Jenkins GUI testing not visible or browser not open but run in background浏览器后台运行不可见
http://wiki.hudson-ci.org/display/HUDSON/Tomcat Tomcat from Windows GUI Testing in Windows Most Wi ...
- MySQL索引设计需要考虑哪些因素?
索引小知识 篇幅有限,索引的基本知识我们就不赘述了,在此,我们尝试说明其中的一个小点-----B+树与B树的区别到底是什么. InnoDB是使用B+树来实现其索引功能的.在B+树中,内节点(非叶子节点 ...
- MyBatis学习总结_Mybatis查询之resultMap和resultType区别
MyBatis的每一个查询映射的返回类型都是ResultMap,只是当我们提供的返回类型属性是resultType的时候,MyBatis对自动的给我们把对应的值赋给resultType所指定对象的属性 ...
- 自动化测试之路2---python安装
借鉴这位老哥的文章http://www.cnblogs.com/shabbylee/p/6792555.html
- tcp、udp、ip、icmp报文格式分析
TCP .UDP .IP. ICMP协议报文格式分析 Tcp报文格式: Wireshark抓包如图: 源端口/目的端口(16bit): 在TCP报文中包涵了源端口/目的端口,源端口标识了发送进程,目的 ...