Amazon EC2 实例无法更新或使用 yum

2024-02-08

我正在使用亚马逊的教程安装 LAMP 服务器 http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/install-LAMP.html。前几条指令涉及使用yum,但我尝试过的每一种方法都导致了相同的消息。我最近发现了一些关于同一问题的其他问题,这些问题都没有改变我的设置。

这是消息:

Loaded plugins: priorities, update-motd, upgrade-helper
Could not retrieve mirrorlist http://repo.us-east-1.amazonaws.com/latest/main/mirror.list error was
12: Timeout on http://repo.us-east-1.amazonaws.com/latest/main/mirror.list: (28, 'Connection timed out after 10001 milliseconds')


One of the configured repositories failed (Unknown),
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. 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/latest

我之前使用相同的教程做过同样的事情,没有遇到任何问题,但那是几个月前的事了。我不知道发生了什么变化,但我微薄的经验让我无法弄清楚。


主机似乎无法联系 yum 服务器。确保实例具有出站互联网访问权限(检查安全组等)。如果实例位于 VPC 中并且安全组看起来不错,您可能需要使用 nat 设备或附加弹性 IP。

祝你好运-

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Amazon EC2 实例无法更新或使用 yum 的相关文章

随机推荐