2

what's the recommended approach for setting up remote rpm repositories to proxy Amazon Linux?

The yum repo files on Amazon linux show a mirror list and then base URLs with UIDs. I don't know if I can count on the Repo-baseurl or if there's a way to feed the mirror list into artifactory.

Do, I need to replicate the entire mirror list and then pull them together in a virtual repository?

Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Repo-id      : amzn2-core/2/x86_64
Repo-name    : Amazon Linux 2 core repository
Repo-revision: 1532545700
Repo-updated : Wed Jul 25 19:08:20 2018
Repo-pkgs    : 9,137
Repo-size    : 8.1 G
Repo-mirrors : http://amazonlinux.us-east-1.amazonaws.com/2/core/latest/x86_64/mirror.list
Repo-baseurl : http://amazonlinux.us-east-1.amazonaws.com/2/core/2.0/x86_64/ecb7f3179dc53ca05863f9df12535c3a24d03bb87b8f3816aaa632d02ff53f2c/
Repo-expire  : 300 second(s) (last: Tue Jul 31 11:46:36 2018)
  Filter     : read-only:present
Repo-filename: /etc/yum.repos.d/amzn2-core.repo

After creating a remote rpm repo called rpm-amzn-remote linked to http://amazonlinux.us-east-1.amazonaws.com/2/core/2.0/x86_64/ecb7f3179dc53ca05863f9df12535c3a24d03bb87b8f3816aaa632d02ff53f2c/ I see the following relative paths when I run repoquery

repoquery --tempcache \
--repofrompath=repo,http://artifactory/rpm-amzn-remote/ --repoid=repo\
--qf="%{version}-%{release}.%{arch} %{location}" --show-duplicates kernel-devel 
# result
4.9.62-10.57.amzn2.x86_64 \
http://artifactory/../../../../blobstore/18381632cff65dcf8dd4b7fe67bb45f58dc85720816c78d03ffa6677cab4b9e1/kernel-devel-4.9.62-10.57.amzn2.x86_64.rpm

and of course, the link cannot be downloaded

6
  • You should go look at the contents of the mirror.list file. Commented Jul 31, 2018 at 14:17
  • Thanks, so that file contains cdn.amazonlinux.com/2/core/2.0/x86_64/… and I haven't yet been able configure an Artifactory remote repository proxy where a yum instance can find the repomd.xml
    – Peter Kahn
    Commented Aug 6, 2018 at 17:49
  • That URL should be usable as-is as the baseurl for the yum repo. Commented Aug 6, 2018 at 17:50
  • Yeah, it really doesn't quite work. Looks like there are assumptions about pathing baked in. Please see the additional info I added with the relative pathing in the URL
    – Peter Kahn
    Commented Aug 8, 2018 at 15:21
  • Were you able to resolve this issue? I am facing exactly the same issue and don't know how to further troubleshoot this
    – Chrisii
    Commented Nov 9, 2022 at 13:15

1 Answer 1

0

This cannot be the right way, but it works for yum/dnf/repoquery

  1. Stand up an EC2 AMZN2 instance can capture the yum config for the repos
  2. Create an artifactory remote rpm-amazonlinux2-blobstore pointing to something like http://amazonlinux.us-east-1.amazonaws.com/blobstore - where your region will be difference
  3. Create an artifactory remote rpm-amazonlinux2-metadata-remote point to something like http://amazonlinux.us-east-1.amazonaws.com/2/core/2.0/x86_64/cc59cb59961f7a2deda5cd28f9db3b1a8fb2a98453c27110a310e8413f7ee6c6 - your region and sha will vary
  4. Create an artifactory virtual (aka group) repo rpm-amazonlinux2 containing the two others with 1: rpm-amazonlinux2-metadata-remote, 2: rpm-amazonlinux2-blobstore so it finds metadata 1st

Now, when you configure yum to pull from http://your-artifactory-instance/rpm-amazonlinux2 then it should work

This was what I came up with in 2018. If you talk to Jfrog support, they may have a much better solution at this point.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .