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
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
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
[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
🌐
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
🌐
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.
🌐
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....
Find elsewhere
🌐
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 has end-of-support date of 2024-11-25 2 httpd_modules available [ =1.0 =stable ] 3 memcached1.5 available \ [ =1.5.1 =1.5.16 =1.5.17 ] 9 R3.4 available [ =3.4.3 =stable ] 10 rust1 available \ [ =1.22.1 =1.26.0 =1.26.1 =1.27.2 =1.31.0 =1.38.0 =stable ] 18 libreoffice available \ [ =5.0.6.2_15 =5.3.6.1 =stable ] 19 gimp available [ =2.8.22 ] 20 †docker
🌐
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
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 › 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
🌐
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 ...
🌐
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.
🌐
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).
🌐
Amazon Web Services
aws.amazon.com › compute › amazon linux 2 › faqs
Amazon Linux 2 FAQs
2 weeks 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:...
🌐
GitHub
gist.github.com › thiagomarini › 7341b676baf9f22f96a614f87d468835
How to install supervisor on Amazon Linux · GitHub
Copy link · @tauseedzaman Amazon Linux 2023 doesn't have amazon-linux-extras. https://cloudkatha.com/amazon-linux-extras-in-2023/ Copy link · Yes, Amazon Linux 2023 is removed amazon-linux-extras.
🌐
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