Created
January 9, 2022 16:07
-
-
Save crazytaxii/878455a1286fcf34d765219cf1c7f332 to your computer and use it in GitHub Desktop.
Upgrade CentOS Linux kernel to latest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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