Centos7 升级内核,非常简单,记录下以便查阅
# yum update kernel
# awk -F\‘ ‘$1=="menuentry " {print i++ " : " $2}‘ /etc/grub2.cfg #查看可用内核列表
# grub2-editenv list # 查看当前默认启动内核
# grub2-set-default 1 # 修改当前默认内核
# reboot
aliyun ecs update kernel
cat /etc/redhat-release
uname -r
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
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
yum -y install --enablerepo="elrepo-kernel" kernel-lt.x86_64 kernel-lt-devel.x86_64
awk -F\‘ ‘$1=="menuentry " {print $2}‘ /etc/grub2.cfg
[[email protected] ~]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed ‘s, release .*$,,g‘ /etc/system-release)"
GRUB_DEFAULT=0
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
原文地址:https://blog.51cto.com/phospherus/2445153
时间: 2024-10-10 01:20:41