2

We have a custom yum repository created using createrepo, which is hosted in an Amazon S3 bucket. We're using the yum-s3-iam plugin configured as explained in this blog post. to allow our ec2-instances to gain access to the protected URLs.

However, we can't seem to get yum to respect the packages in our repository on the target server. When running yum repolist, I can see that the repo is found, but both packages in the repo are excluded.

[ec2-user@lysithea ~]$ sudo yum clean all && sudo yum repolist

Loaded plugins: priorities, s3iam, security, update-motd, upgrade-helper
Cleaning repos: amzn-main amzn-updates epel custom-main
Cleaning up Everything
Loaded plugins: priorities, s3iam, security, update-motd, upgrade-helper
amzn-main                                               | 2.1 kB     00:00     
amzn-main/primary_db                                    | 2.1 MB     00:00     
amzn-updates                                            | 2.3 kB     00:00     
amzn-updates/primary_db                                 | 229 kB     00:00     
epel/metalink                                           | 5.9 kB     00:00     
epel                                                    | 4.2 kB     00:00 
epel/primary_db                                         | 4.2 MB     00:00 
514 packages excluded due to repository priority protections
repo id                              repo name                  status
amzn-main                            amzn-main-Base              3,245
amzn-updates                         amzn-updates-Base             254
epel                                 Extra P...              6,639+514
custom-main                          custom-main                   0+2   

Notice that I get a notification for the reason 514 packages were excluded from "epel", but nothing for "custom-main".

Here's the /etc/yum.repo.d/custom-main.repo file's contents:

[custom-main]
name=custom-main
baseurl=http://<redacted>.s3.amazonaws.com/noarch
enabled=1
s3_enabled=1
gpgcheck=0

And here's the repository layout (which is sync'ed with the s3 bucket using s3cmd):

HaximusPrime:yum_repo ajbrown$ tree .
.
└── noarch
    ├── campaign-galleries-0.8.4-01.noarch.rpm
    ├── repodata
    │   ├── filelists.sqlite.bz2
    │   ├── filelists.xml.gz
    │   ├── other.sqlite.bz2
    │   ├── other.xml.gz
    │   ├── primary.sqlite.bz2
    │   ├── primary.xml.gz
    │   └── repomd.xml
    └── splunkforwarder-5.0.2-149561-linux-2.6-x86_64.rpm

We've verified the server can access the repository, and the plugin is configured correctly. In fact, I've added a few different versions of the same RPM to the repo, and observed the yum repo list output change accordingly (0+3, 0+4, and so on).

I've tried repackaging our proprietary RPM with different architectures, but that doesn't seem to make any difference.

Any ideas? Is there any way to force yum to tell me why the packages aren't being included?

A.J. Brown
  • 123
  • 5
  • What is the output of grep '^priority' /etc/yum.repos.d/* – sciurus Apr 26 '13 at 03:31
  • output of grep '^priority' /etc/yum.repos.d/* is: /etc/yum.repos.d/amzn-main.repo:priority=10 /etc/yum.repos.d/amzn-main.repo:priority=10 /etc/yum.repos.d/amzn-nosrc.repo:priority=10 /etc/yum.repos.d/amzn-preview.repo:priority=10 /etc/yum.repos.d/amzn-preview.repo:priority=10 /etc/yum.repos.d/amzn-updates.repo:priority=10 /etc/yum.repos.d/amzn-updates.repo:priority=10 – A.J. Brown Apr 26 '13 at 16:54

1 Answers1

2

The priorities plugin excluded duplicate packages since yum had already selected those package from a higher-priority repository. So yum is already telling you why the packages are not included. To test whether priorities are related to the problem, try running yum with the priorities plugin disabled: sudo yum --disableplugin=priorities clean all

If that is successful, then consider setting a higher priority for your custom-repo, which currently has no priority set.

ZaSter
  • 339
  • 4
  • 11
  • That worked! It seem pretty odd though, since the packages in my custom repo are not in any of the other repos. Perhaps a bug in the priorities plugin? Can anyone add some clarity to this before I accept the answer? – A.J. Brown Apr 26 '13 at 17:01
  • @A.J.Brown The message about the excluded packages applies to all of the repositories, not just your custom repo. You can check whether this is true by excluding your custom repo in the yum commands, for example, `sudo yum --disablerepo "custom-main" clean all; sudo yum --disablerepo "custom-main" repolist`. If the "packages excluded" message is still printed, then we know the packages involved are not those in your custom repo. If the message does not print, then your custom repo contains packages that are available in one or more of the other repos. – ZaSter Apr 26 '13 at 17:55
  • 1
    I think this is a bad answer. I assume priorities were initially enabled for a reason. Disabling them now will likely lead to problems. Better to set the priority for the custom repo correctly. – sciurus Apr 26 '13 at 20:35
  • 2
    What if, instead of disabling priorities, you set priority=9 in custom-main.repo? – sciurus Apr 26 '13 at 21:10
  • 1
    @sciurus, +1 for pointing that out as I did not intend disabling priorities to be the answer, but just a test along the way. I have revised the answer accordingly. Thanks. – ZaSter Apr 26 '13 at 21:27
  • Ok, setting the priority to 9 and lower gets the same result. Thanks for the clarification everyone. – A.J. Brown Apr 27 '13 at 15:51