6

我刚刚使用来自亚马逊的aws 提供的图像在我的 Windows 10 虚拟机管理程序上安装了 amazon linux 。我能够成功登录。但是,当我执行yum install时,它会失败并出现错误“无法解析主机:cdn.amazonlinux.com”。以下是完整的片段

[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]#

我试过ping cdn.amazonlinux.com,它工作得很好。查看尝试的 URL,看起来传递的 instance_id 和 region 是错误的。他们可能已经在 aws 中工作,但在本地安装时,他们将没有任何价值。我不知道在哪里为 yum 尝试的这些参数设置默认值。

任何解决此问题的指针将不胜感激。我需要先在本地系统上的 aws linux 上尝试一些东西,然后再在 AWS 本身上进行任何计划。我的笔记本电脑托管的 aws linux 映像上的本地开发 R&D 对我的需求来说要快得多。

4

0 回答 0