Skip to content

Instantly share code, notes, and snippets.

@crazytaxii
Created January 9, 2022 16:07
Show Gist options
  • Save crazytaxii/878455a1286fcf34d765219cf1c7f332 to your computer and use it in GitHub Desktop.
Save crazytaxii/878455a1286fcf34d765219cf1c7f332 to your computer and use it in GitHub Desktop.
Upgrade CentOS Linux kernel to latest
#!/bin/bash
set -e
main() {
yum update -y
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y
sudo awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
sudo grub2-set-default 0
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
}
main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment