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

sudo: amazon-linux-extras: command not found
I want to deploy wordpress website using RDS and ec2 and for that i'm taking help of aws hands on tutorial to deploy wordpress with RDS. one point came deploy wordpress and this command is given bu... More on repost.aws
🌐 repost.aws
1
0
May 23, 2023
How to install docker on Amazon Linux2 - Stack Overflow
I wanna create docker image for Amazon ECR. but yum can't find it in my Amazon Linux2. [root@*** ~]# yum install -y docker Loaded plugins: amazon-id, rhui-lb, search-disabled-repos No package docker More on stackoverflow.com
🌐 stackoverflow.com
[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
[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... More on github.com
🌐 github.com
4
July 17, 2024
🌐
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 ... is already installed. ... Check Package Installation: Confirm whether the package providing amazon-linux-extras is installed correctly....
🌐
Commandfound
commandfound.com › posts › amazon-linux-extras-command-not-found-ubuntu
amazon-linux-extras command not found - Ubuntu - CommandFound
March 14, 2024 - If you are using Ubuntu and trying to use the amazon-linux-extras command but encountering a “command not found” error, it’s because this command is specific to Amazon Linux and not available by default on Ubuntu.
🌐
Gesielbernardes
commandfound.com.gesielbernardes.eti.br › post › amazon-linux-extras-command-not-found-ubuntu
amazon-linux-extras command not found - Ubuntu - CommandFound
March 23, 2024 - In this tutorial, we will guide you through the process of installing the amazon-linux-extras command on Ubuntu.
🌐
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.
🌐
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 - To confirm the software version, run the following command: ... $ php --version PHP 8.1.23 (cli) (built: Sep 15 2023 21:56:29) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.23, Copyright (c) Zend Technologies ... (response) /usr/bin/which: no amazon-linux-extras in (/root/.local/bin:/root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/lib/snapd/snap/bin)
Find elsewhere
🌐
GitHub
github.com › awsdocs › amazon-ec2-user-guide › blob › master › doc_source › ec2-lamp-amazon-linux-2.md
amazon-ec2-user-guide/doc_source/ec2-lamp-amazon-linux-2.md at master · awsdocs/amazon-ec2-user-guide
December 19, 2021 - 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).
Author   awsdocs
🌐
Commandfound
commandfound.com › post › amazon-linux-extras-command-not-found-generic_linux
amazon-linux-extras command not found - Generic Linux - CommandFound
March 14, 2024 - If you’re using a Generic Linux distribution and you encounter the error message amazon-linux-extras: command not found, it means that the amazon-linux-extras command is not available by default on your system.
🌐
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.
🌐
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:...
🌐
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 ...
🌐
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
🌐
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.
🌐
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...
Author   opensearch-project
🌐
CodeGenes
codegenes.net › blog › sudo-amazon-linux-extras-command-not-found
Fix 'sudo: amazon-linux-extras: command not found' on AWS EC2: Install Nginx for Node.js App Deployment with MobaXterm — codegenes.net
Basic familiarity with Linux commands and Node.js. First, confirm whether your EC2 instance runs Amazon Linux 2 or 2023. This determines how you’ll fix the amazon-linux-extras error. Open MobaXterm. Click Session > SSH. In the "Remote host" field, enter your EC2 instance’s public IP (found in the AWS EC2 Console).
🌐
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 - Short answer is No. amazon-linux-extras is not available in Amazon Linux 2023. However you can install any newer version of package from the