I ran into the same error message when attempting to create an Amazon Linux 2 instance using the AWS CDK. The CDK currently defaults to Amazon Linux instead of Amazon Linux 2. When you accidentally use an Amazon Linux AMI from 2018, surprise surprise, all sorts of facilities are not available. I posted an easy way to check your version in another answer.

In CDK (and Cloud Formation) make sure to declare your intended generation in your AmazonLinuxImage properties

generation: AmazonLinuxGeneration.AMAZON_LINUX_2
Answer from Derek Bennett on serverfault.com
🌐
Amazon Web Services
aws.amazon.com › compute › amazon linux 2 › faqs
Amazon Linux 2 FAQs
2 weeks ago - A Linux kernel tuned for performance on Amazon EC2. A set of core packages including systemd, GCC 7.3, Glibc 2.26, Binutils 2.29.1 that receive Long Term Support (LTS) from AWS. An extras channel for rapidly evolving technologies that are likely to be updated frequently and outside the Long ...
🌐
AWS re:Post
repost.aws › knowledge-center › ec2-install-extras-library-software
Install software from the Extras Library on an AL2 EC2 instance | AWS re:Post
June 18, 2025 - Note: AWS regularly updates the Extras Library repository. To activate the topic that you want to use, run the following command: ... Note: Replace php8.1 with the topic name. Example output: $ sudo amazon-linux-extras enable php8 .1Topic php8.1 ...
Discussions

Unable to upgrade Amazon Linux 2 Kernel to 5.15 with amazon-linux-extras
Error: "Unable to gain necessary access for possible kernel updates" when running AWS-RunPatchBaseline document via Systems Manager ... How do I upgrade my standard Amazon Linux 2 kernel version 4.14.x to Amazon Linux Extra kernel versions? More on repost.aws
🌐 repost.aws
2
0
December 20, 2023
node.js - sudo: amazon-linux-extras: command not found - Stack Overflow
When I try the command sudo amazon-linux-extras install nginx, it ends up with sudo: amazon-linux-extras: command not found. I also tried the command sudo app update and sudo app install nginx1 but it does not work. Same thing also applies to sudo apt update. More on stackoverflow.com
🌐 stackoverflow.com
ansible - amazon-linux-extras enable vs install - Stack Overflow
What is the difference between amazon-linux-extras enable and amazon-linux-extras install? I am asking because a recent change in our build.sh broke our AWS build - amazon-linux-extras enable ansib... More on stackoverflow.com
🌐 stackoverflow.com
amazon-linux-extras specific version - Stack Overflow
I am trying to install a specific version using amazon-linux-extras but I have no idea how to do it. The usual way of doing it with yum seems to not work. Is there any way to do it? sudo amazon-linux- More on stackoverflow.com
🌐 stackoverflow.com
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › al2 extras library
AL2 Extras Library - Amazon Linux 2
The epel Extra enables the third party EPEL7 repository. As of 2024-06-30 the third-party EPEL7 repository is no longer being maintained. This third-party repository will have no future updates. This means there will be no security fixes for packages in the EPEL repository. See the EPEL section of the Amazon Linux ...
🌐
AWS
docs.aws.amazon.com › amazon linux 2 › release notes › amazon linux 2 release notes › amazon linux 2 release notes for 2020 and earlier › amazon linux 2 release notes
Amazon Linux 2 release notes - Amazon Linux 2
Each topic contains all the ... Amazon Linux 2. The following is the Extras command to list the available topics. ... The following is the Extras command to install a topic. ... In the following example, the Extras command installs the rust1 topic. ... The extras channel provides an AWS curated list of rapidly evolving technologies. These technologies might be updated more frequently ...
🌐
Amazon Web Services
aws.amazon.com › compute › linux from aws › amazon linux 2023 faqs
Amazon Linux 2023 FAQs
2 weeks ago - Besides offering frequent updates ... Amazon Linux 2023 provides a predictable release cadence, flexibility and control over new software updates, and eliminates the operational overhead that comes with creating custom policies to meet standard compliance requirements. No, AL2023 does not have extras...
Top answer
1 of 2
1

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

2 of 2
1

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
Find elsewhere
🌐
AWS re:Post
repost.aws › knowledge-center › amazon-linux-2-kernel-upgrade
Upgrade Amazon Linux 2 kernel version | AWS re:Post
August 13, 2024 - The default kernel installed on Amazon Linux 2 instances is 4.14.x. You can upgrade the default kernel to an Amazon Linux Extra kernel version 5.4.x, 5.10.x, or 5.15x.
🌐
AWS re:Post
repost.aws › questions › QUj8pyDg4UTaGAu_GPVryBLQ › unable-to-upgrade-amazon-linux-2-kernel-to-5-15-with-amazon-linux-extras
Unable to upgrade Amazon Linux 2 Kernel to 5.15 with amazon-linux-extras | AWS re:Post
December 20, 2023 - $ uname -r 5.10.198-187.748.amzn2.x86_64 $ sudo amazon-linux-extras |grep kernel _ kernel-5.4 available [ =stable ] 55 kernel-5.10=latest enabled [ =stable ] 62 kernel-5.15 available [ =stable ] $ sudo amazon-linux-extras disable kernel-5.10 $ sudo amazon-linux-extras install kernel-5.15 -y $ sudo amazon-linux-extras install kernel-5.15 -y Installing kernel Loaded plugins: priorities, update-motd, versionlock Cleaning repos: amzn2-core amzn2extra-docker amzn2extra-kernel-5.15 15 metadata files removed 6 sqlite files removed 0 metadata files removed Loaded plugins: priorities, update-motd, vers
🌐
LinuxVox
linuxvox.com › blog › amazon-linux-extras
Unleashing the Power of Amazon Linux Extras — linuxvox.com
Instead of manually searching for ... application stack. Up-to-date Software: AWS regularly updates the packages in Amazon Linux Extras to ensure they are secure and up-to-date....
🌐
Amazon Web Services
docs.amazonaws.cn › 亚马逊云科技 › amazon linux 2 › user guide › what is amazon linux 2?
What is Amazon Linux 2? - Amazon Linux 2
AL2 is no longer the current version of Amazon Linux. AL2023 is the successor to AL2. For more information, see Comparing AL2 and AL2023 and the list of Package changes in AL2023 in the AL2023 User Guide. AL2 follows the upstream Firefox Extended Support Release (ESR) version closely and updates to the next ESR as soon as available.
🌐
AWS
docs.aws.amazon.com › amazon linux 2 › release notes › amazon linux 2 release notes › amazon linux 2 release notes for 2025 › amazon linux 2 version 2.0.20251121.0 release notes
Amazon Linux 2 version 2.0.20251121.0 release notes - Amazon Linux 2
November 21, 2025 - This release of Amazon Linux 2 ... security updates. For information on the CVEs addressed in this release, see the Amazon Linux Security Center ... For visibility into the status of CVEs that haven't been addressed yet, see the Amazon Linux Security Center ... This section provides details about [al2 extras] kernel-5.10 ...
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › comparing al2 and al2023 › extra packages for enterprise linux (epel)
Extra Packages for Enterprise Linux (EPEL) - Amazon Linux 2023
April 20, 2026 - This third-party repository will have no future updates. This means there will be no security fixes for packages in the EPEL repository. This section will cover options in AL2023 for packages found in EPEL. Extra Packages for Enterprise Linux (EPEL) is a project in the Fedora community with ...
🌐
AWS re:Post
repost.aws › knowledge-center › ec2-linux-update-security-patches
Update EC2 Linux with the latest updates | AWS re:Post
3 weeks ago - To get access to packages from Extra Packages for Enterprise Linux 9 (EPEL9) for your AL2023 instances, use the Supplementary Packages for Amazon Linux (SPAL). For installation instructions, see Tutorial: Configure SPAL repository on AL2023.