6

I'm trying to install amazon-linux-extras using the instructions here:

sudo yum install -y amazon-linux-extras

And I get the following error:

amzn-main                                                                                                                             | 2.1 kB  00:00:00     
amzn-updates                                                                                                                          | 3.8 kB  00:00:00     
839 packages excluded due to repository priority protections
No package amazon-linux-extras available.
Error: Nothing to do

Why is the package not available?

I have EPEL installed, so I don't understand what's going on.

UPDATE

Output of

sudo yum repolist

Loaded plugins: priorities, update-motd, upgrade-helper
843 packages excluded due to repository priority protections
repo id                       repo name                                               status
!amzn-main/latest             amzn-main-Base                                               5,934
!amzn-updates/latest          amzn-updates-Base                                            4,722
epel/x86_64                   Extra Packages for Enterprise Linux 7 - x86_64          12,517+843
repolist: 23,173
Aerodynamika
  • 216
  • 1
  • 2
  • 8

4 Answers4

9

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
Derek Bennett
  • 191
  • 1
  • 3
3

It looks like this issue is potentially being caused by YUM priorities. You could try disabling priorities to see if that is the issue. The config file used to disable yum priorities can be found here.

/etc/yum/pluginconf.d/priorities.conf

Change the config to be "enabled = 0" and try again.

Stratos
  • 39
  • 2
0

You can't install amazon-linux-extras on Amazon Linux 2018 AMI

Mike Nguyen
  • 101
  • 2
0

I'm able to install on EC2 instance of AMI "Amazon Linux 2 AMI (HVM)"

Gowtham
  • 101
  • 1