If you are using amazon linux 2023 amazon-linux-extras does not exists.

In the earlier versions if you are encountering an error while trying to install "aws linux-extras," there could be a few possible reasons.

Here are some troubleshooting steps you can try:

1. Update the package manager: Before installing any packages, it's a good practice to update the package manager's cache. Run the following command:

sudo yum update

2. Check the package name: Make sure you have the correct package name for installing AWS Linux Extras. Double-check the name and ensure there are no typos. The correct package name is typically in the format of "aws-<service>-linux-extras" (e.g., aws-efs-utils-linux-extras, aws-nitro-enclaves-cli-linux-extras).
3. Confirm availability: Verify that the "aws linux-extras" package is available in the package repository you are using. The availability of packages can vary depending on the Linux distribution and the package repository configuration. You can search for the package using the package manager. For example:
sudo yum search aws-<service>-linux-extras

4. Check network connectivity: Ensure that your server has proper network connectivity to access the package repositories. You can test the connectivity by running other commands like ping or trying to download other packages.
5. Repository configuration: If you're using a custom or non-standard repository, double-check the repository configuration to make sure it is set up correctly. Verify that the repository URL and configuration files are accurate.
6. Repository cache: Clear the local package manager cache and try updating it again. Run the following commands:
sudo yum clean all
sudo yum makecache