amazon linux on premise: yum update fails
Asked Answered
R

1

7

I Just installed amazon linux on my windows 10 hypervisor using aws provided image from amazon. I am able to login successfully. However when I do yum install anything it just fails with error "Could not resolve host: cdn.amazonlinux.com". Following is the full snippet

[root@cloudimg yum]# yum install curl
Loaded plugins: langpacks, priorities, update-motd
https://cdn.amazonlinux.com/2/core/2.0/x86_64/f5ab60d117aab318ddc588ab7dbac074cc20ddf36a924287c55fbd593496ae79/repodata/repomd.xml?instance_id=fail&region=URLError: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
amzn2extra-docker/2/x86_64/pri FAILED
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/primary.sqlite.gz: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/primary.sqlite.gz: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
Trying other mirror.


 One of the configured repositories failed (Amazon Extras repo for docker),
 and yum doesn't have enough cached data to continue. At this point the only
 safe thing yum can do is fail. There are a few ways to work "fix" this:

     1. Contact the upstream for the repository and get them to fix the problem.

     2. Reconfigure the baseurl/etc. for the repository, to point to a working
        upstream. This is most often useful if you are using a newer
        distribution release than is supported by the repository (and the
        packages for the previous distribution release still work).

     3. Run the command with the repository temporarily disabled
            yum --disablerepo=amzn2extra-docker ...

     4. Disable the repository permanently, so yum won't use it by default. Yum
        will then just ignore the repository until you permanently enable it
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable amzn2extra-docker
        or
            subscription-manager repos --disable=amzn2extra-docker

     5. Configure the failing repository to be skipped, if it is unavailable.
        Note that yum will try to contact the repo. when it runs most commands,
        so will have to try and fail each time (and thus. yum will be be much
        slower). If it is a very temporary problem though, this is often a nice
        compromise:

            yum-config-manager --save --setopt=amzn2extra-docker.skip_if_unavailable=true

failure: repodata/primary.sqlite.gz from amzn2extra-docker: [Errno 256] No more mirrors to try.
https://cdn.amazonlinux.com/2/extras/docker/18.09.9/x86_64/6f06d82b5b1fa3d35af7a537bd9f3fa1d95d238361558bbb1e6a47c219c3adb2/repodata/primary.sqlite.gz: [Errno 14] curl#6 - "Could not resolve host: cdn.amazonlinux.com"
[root@cloudimg yum]#

I have tried pinging cdn.amazonlinux.com and it works just fine. Looking at the attempted URL it looks like passed instance_id and region are wrong. They may have worked within aws but with on premises install they wouldn't have any value. I have no clue where to set default values for these parameters which are attempted by yum.

Any pointer to solve this problem will be much appreciated. My need is to try something on aws linux on my local system before I plan anything on AWS itself. Local development R&D on my laptop hosted aws linux image is much faster for my needs.

Raney answered 8/11, 2019 at 9:57 Comment(2)
Did you find any solution?Coadjutor
amazon-linux never worked for me. Switched to amazon-linux-2 within docker and that worked very well. Identical behavior in terms of package update/upgrade on EC2 and that on docker. That's what I have been using since then.Raney
F
0

Unfortunately this isn't an answer, but I don't have enough reputation in order to comment. (unintended consequences, stackoverflow)

Although you can ping the cdn.amazonlinux.com address, I don't think you can access files there without authentication. If you access any path, you'll get an XML message that states "Access Denied" which is probably not well displayed as a part of the yum tool output.

I have been doing a bit of digging around for the publicly available package repo address for amazon linux packages so I can run a VM on my computer, but have not found a resolution. Amazon doesn't seem to make this available and nobody seems to be mirroring it externally.

Tons of search results for "adding a repo to your amazon linux instance" including EPEL and others, but no results for anyone saying "Add the Amazon Linux repo to your on-prem or outside-of-aws vm"

Forborne answered 24/8, 2022 at 18:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.