AWS yum repository – Easy way to set up and fix errors

Table of Contents

AWS Yum repository makes software package management easy.

These repositories provide a single source of updates and avoid numerous copies of software applications.

Amazon users can make use of Amazon repositories to install different software packages. However, for specific packages, it may require a custom YUM repository.

That’s why we regularly receive requests to create an AWS Yum repository as part of our Server Management Services.

In this write-up, we’ll see how our Support Engineers create a yum repository in AWS server and fix related errors.



How we add repositories in Amazon Linux

Amazon Linux has two repositories by default, namely amzn-main and amzn-updates. As we already saw, to install specific packages, Amazon instance need custom Yum repository set up.

Here, we begin with adding the repository information to the /etc/yum.conf file or to its own repository.repo file in the /etc/yum.repos.d directory.

To add a yum repository to /etc/yum.repos.d, our Support Engineers follow the below steps.

1. Initially, we find the location of the .repo file. Again, depending on the repository you add, the location will differ.

For example,

2. Next, we add the repository by using yum-config-manager command.

yum-config-manager --add-repo

3. After that, we enable a yum repository in /etc/yum.repos.d with the following command.

yum-config-manager --enable epel

In addition, we use a command  yum install , to enable the EPEL repository on Amazon Linux 2.

That’s it, we have successfully added a yum repository on Amazon Linux.

However, we always ensure to enable only an authenticated repository to avoid security breaches on the server.


How we fixed common errors with Yum repository

From our experience in managing servers, we’ve seen customers facing problems after adding a new repository or while using it. Now, let’s check on how our Support Engineers resolve errors related to the AWS repository​.


1. Bad public DNS Settings

Recently, one of our customers reported that his Yum command did not work after creating a new yum repository on his AWS server. While installing a package, he got an error like,

Loaded plugins: priorities, update-motd, upgrade-helper
Could not retrieve mirrorlist error was
12: Timeout on (28, 'Connection timed out after 10001 milliseconds')
One of the configured repositories failed (Unknown)

Then, our Support Engineers found this error caused due to bad public DNS settings of the EC2 instance.

Therefore, we solved this error by properly updating the public DNS as follows.

  1. We logged in to and selected Services > VPC
  2. Then, we selected the VPC connected to the EC2
  3. At last, we clicked Edit option > Change DNS hostnames to YES


That enabled the DNS hostname and the problem was solved.


2. Blocked traffic

Similarly, another customer got an error while running command yum install httpd. The error looked like as follow.

Loaded plugins: priorities, update-motd, upgrade-helper Errno 12 Timeout on (28, 'Connection timed out after 10161 milliseconds')
Trying other mirror.

Error downloading packages:
generic-logos-17.0.0-2.5.amzn1.noarch: failure: Packages/generic-logos-17.0.0-2.5.amzn1.noarch.rpm from amzn-main: Errno 256 No more mirrors to try.

On checking, our Support Engineers found that the problem was with network ACL.

Also, he had a network ACL setup for the custom VPC subnet that blocked all inbound and outbound HTTP/ HTTPS traffic.

Therefore, we allowed HTTP and HTTPS traffic on the ACL network for the subnet that the instance sits in.

This fixed the problem and the installation of packages via Yum worked fine.


[Do you get trouble while creating AWS yum repository? Our AWS Experts can fix it for you.]



In a nutshell, users may face errors while creating an AWS yum repository, because of bad public DNS settings of an EC2 instance or incorrect ACL, network settings. Today, we saw how our Support Engineers set up YUM repository and fix related errors.

Leave a Comment

Your email address will not be published. Required fields are marked *

Social Share


Cheapest Web Hosting

Fasters Web Hosting Promo
Scroll to Top

Launch your Website at RS599

Create a professional website yourself with our domain hosting combo. Get Extra benefits at this Year end Sale with 10% OFF and Enjoy Amazing Deels on Shared Hosting!

Starting at Only RS599/Year

Year End Sale


Use Code STARTBIZ at Checkout.

Create an earning opportunity with A Web Hosting Business

Become reseller and start reselling domains, web hosting, ssl certificates and More.

45% OFF

Starting at RS399/Month


Use coupon: at the checkout.