使用 EC2 实例创建 AWS EC2 Own AMI 时出错

Getting error while creating the AWS EC2 Own AMI using EC2 instance

我正在按照此 link http://www.idevelopment.info/data/AWS/AWS_Tips/AWS_Management/AWS_10.shtml 在 AWS EC2 中创建自己的 centOS 64 位 ami。现在,我正在为 EC2 实例创建自己的 AMI。

所以,当我发出这个命令时 # yum -c /opt/ec2/yum/yum-xen.conf --installroot=/mnt/ec2-image -y groupinstall Base 我得到了以下错误,

yum -c /opt/ec2/yum/yum-xen.conf --installroot=/mnt /ec2-image -y groupinstall Base 没有安装组文件。 也许 运行: yum groups mark convert (see man yum) 无法检索镜像列表 http://repo.$awsregion.$awsdomain/$releasever/main /mirror.list 错误是 14: PYCURL 错误 6 - "Could not resolve host: repo.$awsregion.$awsdomain"

配置的存储库之一失败(未知), 并且 yum 没有足够的缓存数据来继续。此时唯一 yum 可以做的安全事情就是失败。有几种方法可以实现 "fix" 这个:

 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. Disable the repository, 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 <repoid>

 4. 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=<repoid>.skip_if_unavailable=true

  Cannot find a valid baseurl for repo: amzn-main/$releasever

我想不通这个问题。谁能帮我解决这个问题,我的想法也会有所帮助。

TIA...,

以上可能有以下原因。 1. 检查你的服务器和你上网的交换机之间是否有代理?如果有,请移除代理。

  1. 建议使用yum clear all 命令清除所有内容。

  2. 检查 yum.conf 文件并查看存储库是否被注释等。取消对存储库的注释。

  3. 您可能还想禁用最快的镜像插件。如果上述 1、2、3 失败,请检查此项。

  4. 如果以上 4 个选项都不起作用,则可能只是您的 dns 有问题。