April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

April 2024
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

update your Linux kernel from 3.1 to 4.7.2-1

Update Your Linux Kernel in Place (Running CentOS 7 or Above)

If you started an instance from the official CentOS AMI on AWS, you are running kernel 3.1 as of this writing, while you could easily take advantage of improved security features of newer kernels that are already available in a stable release. Here is how to update your Linux kernel from 3.1 to 4.7.2-1 in place.

Step 1. Import the repo key

Import the GPG key for the repository:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

Step 2. Install the repository

Install the repository that holds your new kernel:

yum install http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

You can peek inside the configuration file for the repository to see what it will be doing:

nano /etc/yum.repos.d/elrepo.repo

Step 3. Enable the repository

Enable the repository with this command:

yum --enablerepo=elrepo-kernel install kernel-ml

Step 4. Install the RPM

Install your new kernel for CentOS/RHEL 7.02:

yum install http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Step 5. List all available kernels

List all kernels that are available to the grub bootloader on your system:

awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg

Step 6. Select the new kernel

From the list of available kernels, select the new kernel:

grub2-set-default 0

The number 0 denotes the first kernel in the list.

Step 7. Save the new configuration and reboot

Save your new configuration:

grub2-mkconfig -o /boot/grub2/grub.cfg

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>