Amazon Linux 2023 Officially Released
enable epel in AWS Linux 2022
Configuring amazon-linux-extras epel on Amazon Linux 2 in a private subnet - Stack Overflow
For anyone else who comes across this problem and doesn't have the luxury of using an alternative library libgdiplus can be installed through EPEL on Amazon Linux with:
You should check that epel is enabled using
yum repolist enabled
If it's not then you can edit /etc/yum.repos.d/epel.repo and change the [epel] section
enabled=0
to
enabled=1
or use
yum-config-manager --enable epel
Update for Amazon Linux 2:
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
Or,
sudo amazon-linux-extras install epel -y
Or,
sudo amazon-linux-extras enable epel
sudo yum install -y epel-release
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
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.