Avn*_*ish 6 amazon-linux amazon-linux-2
我刚刚使用来自亚马逊的aws 提供的图像在我的 Windows 10 管理程序上安装了 amazon linux 。我能够成功登录。但是,当我执行yum 安装任何东西时,它只会失败并显示错误“无法解析主机: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®ion=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]#
Run Code Online (Sandbox Code Playgroud)
我试过 ping cdn.amazonlinux.com,它工作得很好。查看尝试的 URL,它看起来像传递的 instance_id 和 region 是错误的。他们可能在 aws 中工作过,但在本地安装时,它们没有任何价值。我不知道在哪里为 yum 尝试的这些参数设置默认值。
任何解决此问题的指针将不胜感激。我需要先在本地系统上的 aws linux 上尝试一些东西,然后再在 AWS 本身上进行任何计划。我的笔记本电脑托管的 aws linux 映像上的本地开发 R&D 对我的需求来说要快得多。
小智 0
不幸的是,这不是一个答案,但我没有足够的声誉来发表评论。(意想不到的后果,stackoverflow)
虽然您可以 ping cdn.amazonlinux.com 地址,但我认为您无法在未经身份验证的情况下访问那里的文件。如果访问任何路径,您将收到一条 XML 消息,指出“访问被拒绝”,该消息可能无法很好地显示为 yum 工具输出的一部分。
我一直在挖掘亚马逊 Linux 软件包的公开可用软件包存储库地址,以便我可以在我的计算机上运行虚拟机,但尚未找到解决方案。亚马逊似乎没有提供此功能,而且似乎没有人在外部镜像它。
大量关于“将存储库添加到您的亚马逊 Linux 实例”的搜索结果,包括 EPEL 等,但没有任何人说“将 Amazon Linux 存储库添加到您的本地或 AWS 虚拟机之外”的结果
| 归档时间: |
|
| 查看次数: |
837 次 |
| 最近记录: |