You can use the amazon-linux-extras repository to upgrade the kernel
First, run this command to get all available kernel versions
sudo amazon-linux-extras |grep kernel
you will see a response similar to this
_ kernel-5.4 available [ =stable ]
55 kernel-5.10=latest enabled [ =stable ]
62 kernel-5.15 available [ =stable ]
the kernel version marked as enabled is the one installed on your machine
to upgrade to the newer version (for example kernel-5.15), just run this command sudo amazon-linux-extras install kernel-5.15 -y
Now, you need to reboot the server with sudo reboot
After rebooting, run the command uname -r to make sure that the newer version is successfully installed
for more information, please refer to this link
Answer from Mai Elshiashi on serverfault.comYou can use the amazon-linux-extras repository to upgrade the kernel
First, run this command to get all available kernel versions
sudo amazon-linux-extras |grep kernel
you will see a response similar to this
_ kernel-5.4 available [ =stable ]
55 kernel-5.10=latest enabled [ =stable ]
62 kernel-5.15 available [ =stable ]
the kernel version marked as enabled is the one installed on your machine
to upgrade to the newer version (for example kernel-5.15), just run this command sudo amazon-linux-extras install kernel-5.15 -y
Now, you need to reboot the server with sudo reboot
After rebooting, run the command uname -r to make sure that the newer version is successfully installed
for more information, please refer to this link
Kernel live patches are available for Amazon Linux 2 with kernel version 4.14.165-131.185 or later. To check your kernel version, run the following command.
[root@actsupport ~]# yum list kernel
If you already have a supported kernel version, skip this step. If you do not have a supported kernel version, run the following commands to update the kernel to the latest version and to reboot the instance.
[root@actsupport ~]# sudo yum install -y kernel
[root@actsupport ~]# reboot
Install the yum plugin for Kernel Live Patching.
[root@actsupport ~]# yum install -y yum-plugin-kernel-livepatch
Enable the yum plugin for Kernel Live Patching.
[root@actsupport ~]# yum kernel-livepatch enable -y
This command also installs the latest version of the kernel live patch RPM from the configured repositories.
To confirm that the yum plugin for kernel live patching has installed successfully, run the following command.
[root@actsupport ~]# rpm -qa | grep kernel-livepatch
When you enable Kernel Live Patching, an empty kernel live patch RPM is automatically applied. If Kernel Live Patching was successfully enabled, this command returns a list that includes the initial empty kernel live patch RPM.
Update and start the kpatch service. This service loads all of the kernel live patches upon initialization or at boot.
[root@actsupport ~]# yum update kpatch-runtime
[root@actsupport ~]# systemctl enable kpatch.service
Configure the Amazon Linux 2 Kernel Live Patching repository, which contains the kernel live patches.
[root@actsupport ~]# amazon-linux-extras enable livepatch
Unable to upgrade Amazon Linux 2 Kernel to 5.15 with amazon-linux-extras
Anyone know how to get the Amazon Linux 2 kernel source RPMs for 5.10 and 5.15?
yum - Unable to update kernel in Amazon Linux 2 as per Security Advisory: ALAS-2021-1719 - Stack Overflow
I've automated WireGuard on AWS with Amazon Linux 2 and Network Load Balancer
Need these for a project i'm working on, but only 4.14 is available from their RPM repos. (e.g. there is no kernel-5.10 or kernel-5.15 packages available to download with yumdownloader.). I am not too familiar with AL2, but it seems like their 5.10 and 5.15 kernels come from a different packaging scheme (amazon-linux-extras) and Source RPMs may not be available?
You can use the amazon-linux-extras repository to upgrade the kernel
First, run this command to get all available kernel versions sudo amazon-linux-extras |grep kernel
you will see a response similar to this
_ kernel-5.4 available [ =stable ]
55 kernel-5.10=latest enabled [ =stable ]
62 kernel-5.15 available [ =stable ]
the kernel version marked as enabled is the one installed on your machine
To upgrade to the newer version (for example, to upgrade to kernel-5.15), run this command sudo amazon-linux-extras install kernel-5.15 -y
Now, you need to reboot the server with sudo reboot
After rebooting, run the command uname -r to see the kernel version installed. It should be the same version that you chose above.
for more information, please refer to this link
You can try to clean the cache first using
yum clean all
then you should update the kernel
yum update
Your repositories may not be correct.
To define a new repository, you can either add a [repository] section to the /etc/yum.conf file, or to a .repo file in the /etc/yum.repos.d/ directory. All files with the .repo file extension in this directory are read by yum, and it is recommended to define your repositories here instead of in /etc/yum.conf
The "yum repolist" command can be used to list installed and enabled repositories.
yum repolist
You should check your network firewall, Security group, subnets...
- Make sure that security group is whitelisted all inbound and outbound.
- Public subnets:
- Make sure the route table for the public subnet is associated with this subnet
- Route 0.0.0.0/0 pointing to internet gateway.
- Private subnets:
- Created a NAT Gateway in a Public subnet.
- Make sure the route table has a route 0.0.0.0/0 pointing to NAT