Check the Amazon image version of your EC2 instance.

Command: cat /etc/image-id

If it is Amazon Linux 2023, it does not have extras.

However, most of the packages are already included in the distro.

You can run sudo yum install nginx which will install version 1.22

Answer from User123456 on Stack Overflow
Discussions

[Bug] - amazon-linux-extras: command not found on 2023.0.20230315.0
We used to run amazon-linux-extras to install various additional packages on amazonlinux. Starting from the latest push command disappeared. To Reproduce FROM public.ecr.aws/amazonlinux/amazonlinux... More on github.com
🌐 github.com
8
March 16, 2023
amazonlinux:2022 not support amazon-linux-extras command
Hi, I'm try to use amazonlinux:2022 as our base image, and I can see [amazon-linux-extras] this command everywhere. but actually I got command not found after input amazon-linux-extras install ... More on github.com
🌐 github.com
2
September 8, 2022
ssh - Error: sudo: amazon-linux-extras: command not found - Stack Overflow
System Information: Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1045-aws x86_64) Problem: Trying to run sudo amazon-linux-extras install epel -y and sudo yum install -y chromium Because i need it for my Di... More on stackoverflow.com
🌐 stackoverflow.com
[BUG] /bin/sh: line 1: amazon-linux-extras: command not found
Hi, [BUG] 2024-07-17 18:03:37,502 [ERROR] Command 000 (amazon-linux-extras install java-openjdk11 -y) failed 2024-07-17 18:03:37,502 [DEBUG] Command 000 output: /bin/sh: line 1: amazon-linux-extras: command not found Thanks. More on github.com
🌐 github.com
4
July 17, 2024
🌐
Super User
superuser.com › questions › 1487748 › unable-to-find-or-install-amazon-linux-extras
Unable to find or install amazon-linux-extras - Super User
I found a workaround to install nginx though: Using epel-release, that worked fine without the use of amazon-linux-extras... ... So Nginx is preinstalled in Amazon Linux 2022, so really, you should upgrade the distribution you are using (Amazon Linux 2). Generally, if you need to install on Amazon Linux 2 you should build from source. The code below is generally the method today, but it is typical to add/want extra modules which may modify the flags for ./auto/configure, for example.
🌐
GitHub
github.com › amazonlinux › amazon-linux-2023 › issues › 290
[Bug] - amazon-linux-extras: command not found on 2023.0.20230315.0 · Issue #290 · amazonlinux/amazon-linux-2023
March 16, 2023 - We used to run amazon-linux-extras to install various additional packages on amazonlinux. Starting from the latest push command disappeared. To Reproduce FROM public.ecr.aws/amazonlinux/amazonlinux:latest RUN amazon-linux-extras install ...
Author   amazonlinux
🌐
GitHub
github.com › amazonlinux › container-images › issues › 80
amazonlinux:2022 not support amazon-linux-extras command · Issue #80 · amazonlinux/container-images
September 8, 2022 - Hi, I'm try to use amazonlinux:2022 as our base image, and I can see [amazon-linux-extras] this command everywhere. but actually I got command not found after input amazon-linux-extras install xxx. By the way, the default yum repo provid...
Author   amazonlinux
🌐
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: The following resolution applies only to instances that run on AL2. You can't use the following resolution steps for instances that run on Amazon Linux 2023 (AL2023). To install a software package, complete the following steps: Use SSH to connect to your Amazon EC2 Linux instance. To check whether you installed the amazon-linux-extras package, run the following command:
Find elsewhere
🌐
CloudKatha
cloudkatha.com › home › can you install amazon-linux-extras in amazon linux 2023?
Can you Install amazon-linux-extras in Amazon Linux 2023? - CloudKatha
July 31, 2023 - And I feel this makes things a bit less complex as everything can be found under the same umbrella. Okay just to re-iterate what we discussed. Remember amazon-linux-extras is not available on Amazon Linux 2023.
🌐
Stack Overflow
stackoverflow.com › questions › 68828553 › error-sudo-amazon-linux-extras-command-not-found
ssh - Error: sudo: amazon-linux-extras: command not found - Stack Overflow
Also tried installing linux-headers-aws ... is already installed. ... Check Package Installation: Confirm whether the package providing amazon-linux-extras is installed correctly....
🌐
GitHub
github.com › opensearch-project › opensearch-ci › issues › 476
[BUG] /bin/sh: line 1: amazon-linux-extras: command not found · Issue #476 · opensearch-project/opensearch-ci
July 17, 2024 - Hi, [BUG] 2024-07-17 18:03:37,502 [ERROR] Command 000 (amazon-linux-extras install java-openjdk11 -y) failed 2024-07-17 18:03:37,502 [DEBUG] Command 000 output: /bin/sh: line 1: amazon-linux-extras: command not found Thanks.
Author   opensearch-project
🌐
The Tools Trunk
thetoolstrunk.com › home › amazon linux extras command not found | fast fix steps
Amazon Linux Extras Command Not Found | Fast Fix Steps
January 1, 2026 - The amazon-linux-extras command not found error usually means you’re on AL2023 or the extras tool isn’t installed on AL2.You typed amazon-linux-extras, hit Enter, and your shell pushed back with a message. The upside is that this error narrows the problem to a short list of causes.
🌐
LinuxVox
linuxvox.com › blog › amazonlinuxextras-command-not-found
Troubleshooting amazonlinux-extras command not found — linuxvox.com
When you see the "amazon-linux-extras command not found" error, it means that the system cannot locate the amazon-linux-extras executable in the directories specified in the PATH environment variable.
🌐
SysAdminSage
sysadminsage.com › home › blog › troubleshooting amazon-linux-extras: command not found
Troubleshooting Amazon-linux-extras: Command Not Found - SysAdminSage
June 8, 2024 - Another reason for encountering the error message could be due to a missing package installation. The “amazon-linux-extras” command relies on certain packages being installed on your system for it to work correctly. If these packages are missing or not properly installed, you may see the ...
🌐
Amazon Web Services
aws.amazon.com › compute › amazon linux 2 › faqs
Amazon Linux 2 FAQs
1 week ago - Please note that Kernel Live Patching ... Kernel in the Extras will not receive kernel live patches. To find out whether the current Linux Kernel continue to receive live patches or not, and when that support window ends, use the following yum command:...
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › al2 on amazon ec2 › al2 tutorials › tutorial: install a lamp server on al2
Tutorial: Install a LAMP server on AL2 - Amazon Linux 2
If you receive an error stating sudo: amazon-linux-extras: command not found, then your instance was not launched with an Amazon Linux 2 AMI (perhaps you are using the Amazon Linux AMI instead).
🌐
Commandfound
commandfound.com › post › amazon-linux-extras-command-not-found-amazon_linux
amazon-linux-extras command not found - Amazon Linux - CommandFound
In this tutorial, we will guide you through the process of installing the amazon-linux-extras command on Amazon Linux.
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › al2 extras library
AL2 Extras Library - Amazon Linux 2
Describes AL2 Extras. Find out about lifespan, support, and package changes.
🌐
GitHub
github.com › amazonlinux › amazon-linux-2023 › issues › 189
[Package Request] - how to install extras packages in amazonlinux:2022 docker image · Issue #189 · amazonlinux/amazon-linux-2023
September 8, 2022 - Hi, I'm try to use amazonlinux:2022 as our base docker image, and I can see [amazon-linux-extras] this command everywhere. but actually I got command not found after input amazon-linux-extras install xxx. By the way, the default yum repo...
Author   amazonlinux