Centos7及ali ecs 升級內核

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  

[root@k8s-bj-zw-bgp2 ~]# 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
相關文章
相關標籤/搜索