首页 > 系统相关 >[CentOS7]更换内核

[CentOS7]更换内核

时间:2022-08-14 20:56:15浏览次数:66  
标签:kernel x86 210 elrepo CentOS7 64 内核 更换 el7

1. 添加repo库

yum -y install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

2. 导入签名

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

3. 差看长期支持版本

[root@localhost ~]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-lt
kernel-lt.x86_64                        5.4.210-1.el7.elrepo       elrepo-kernel
kernel-lt-devel.x86_64                  5.4.210-1.el7.elrepo       elrepo-kernel
kernel-lt-doc.noarch                    5.4.210-1.el7.elrepo       elrepo-kernel
kernel-lt-headers.x86_64                5.4.210-1.el7.elrepo       elrepo-kernel
kernel-lt-tools.x86_64                  5.4.210-1.el7.elrepo       elrepo-kernel
kernel-lt-tools-libs.x86_64             5.4.210-1.el7.elrepo       elrepo-kernel
kernel-lt-tools-libs-devel.x86_64       5.4.210-1.el7.elrepo       elrepo-kernel

4. 安装长期稳定版本

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

5. 切换内核版本

# 查看所有可用内核版本
[root@localhost ~]# grubby --info=ALL | grep ^kernel
kernel=/boot/vmlinuz-0-rescue-e6b1be1665514df5b07c55fd799bfbf0
kernel=/boot/vmlinuz-5.4.210-1.el7.elrepo.x86_64
kernel=/boot/vmlinuz-3.10.0-1160.66.1.el7.x86_64
kernel=/boot/vmlinuz-3.10.0-1160.el7.x86_64
kernel=/boot/vmlinuz-0-rescue-f8f95d1d9b764ae99f2fc289a16fc263
#查看默认的内核版本
[root@localhost ~]# grubby --default-kernel
/boot/vmlinuz-3.10.0-1160.66.1.el7.x86_64
# 设置内核版本
grubby --set-default "/boot/vmlinuz-5.4.210-1.el7.elrepo.x86_64"
#重启
reboot

6. 删除旧内核

[root@localhost ~]# rpm -qa | grep kernel
kernel-tools-libs-3.10.0-1160.66.1.el7.x86_64
kernel-3.10.0-1160.66.1.el7.x86_64
kernel-tools-3.10.0-1160.66.1.el7.x86_64
kernel-3.10.0-1160.el7.x86_64
kernel-lt-5.4.210-1.el7.elrepo.x86_64

yum remove kernel-tools-libs-3.10.0-1160.66.1.el7.x86_64 \
kernel-3.10.0-1160.66.1.el7.x86_64 \
kernel-tools-3.10.0-1160.66.1.el7.x86_64 \
kernel-3.10.0-1160.el7.x86_64

[root@localhost ~]# uname -r
5.4.210-1.el7.elrepo.x86_64

END

标签:kernel,x86,210,elrepo,CentOS7,64,内核,更换,el7
From: https://www.cnblogs.com/leoshi/p/16586291.html

相关文章

  • centos7使用 Docker Engine部署gitlab
    1.安装docker-ce卸载旧版本:yumremovedockerdocker-commondocker-selinuxdocker-engine一、虚拟机联网,安装yum工具执行以下命令yuminstall-yyum-utils\dev......
  • centOS7 firewall 防火墙基本操作
    centOS7firewall防火墙基本操作运维家 2022-07-2309:09 发表于北京收录于合集#防火墙1个#linux22个 一、防火墙的开启、关闭、禁用命令 (1)设置开机......
  • centos7搭建bsc全节点
    Centos7搭建bsc全链节点服务器配置 CPU:8Cores-16Threads RAM:131072MB Storage:2x2000GBNVMe Bandwidth:8400.65GBof10000GB OS: CentOS7x64 服务......
  • CentOs7安装node
     1、到node官网下载自己需要的压缩包(https://nodejs.org/zh-cn/download/)下载后按照如下内容安装:[root@localhost~]#tar-zxvf/usr/local/software/node-v14.7.......
  • Jupyter Notebook切换内核无法打开
    报错如下所示:[I18:13:05.891NotebookApp]KernelRestarter:restartingkernel(4/5),newrandomportsTraceback(mostrecentcalllast):File"D:\Anaconda\Ma......