Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Upgrade Kernel on Centos7 via ELRepo
Install the ELRepo and GPG key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install -y http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
Enable kernel updates from elrepo
yum-config-manager --enable elrepo-kernel
Remove old kernel stuff
yum remove -y kernel-{devel,tools,tools-libs}
Install the ELRepo built kernel and grub2-tools
yum install -y kernel-ml kernel-ml-{devel,tools,tools-libs} grub2-tools
We ensure these exist on the off chance they were removed during the kernel stuff above
yum install -y dkms gcc redhat-lsb-languages
Build a new grub config with the ELRepo kernel entry
grub2-mkconfig -o /boot/grub2/grub.cfg
grep vmlinuz /boot/grub2/grub.cfg
Ensure we boot the latest kernel
grub2-set-default 0
@thpryrchn

This comment has been minimized.

Copy link

thpryrchn commented Jul 25, 2019

I think you should remove the -y from yum remove -y kernel-{devel,tools,tools-libs} so that the user can see what all will be removed before they commit to running it.

@pgporada

This comment has been minimized.

Copy link
Owner Author

pgporada commented Jul 25, 2019

Hi @thpryrchn,

That's a good idea, but this was initially what I used on servers before I built ansible automation to do it for me. When starting up the server and having a script perform the task, you don't exactly need to worry what packages are removed as long as the server comes online post-reboot with the new el-repo kernel.

@thpryrchn

This comment has been minimized.

Copy link

thpryrchn commented Jul 25, 2019

Aww.. BTW, the repo install has changed... It is now yum -y install https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm

@pgporada

This comment has been minimized.

Copy link
Owner Author

pgporada commented Jul 25, 2019

Thanks! I haven't used any of this particular code in years and it is woefully out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.