And*_*son 41 yum amazon-ec2 amazon-web-services
我正在使用亚马逊的教程来安装LAMP服务器.前几个指令涉及使用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
Run Code Online (Sandbox Code Playgroud)
我之前做过同样的事情,没有遇到任何问题,使用相同的教程,但是几个月前.我不知道发生了什么变化,但我微薄的经历让我无法搞清楚.
小智 38
看起来主机在联系yum服务器时遇到问题.确保实例具有出站Internet访问权限(检查安全组等).如果实例位于VPC中并且安全组看起来很好,则可能需要使用nat设备或附加弹性IP.
祝好运-
phi*_*son 17
如果您的VPC上有S3端点,那么这将导致yum失败,因为repo文件存储在S3中.要解决此问题,请将以下策略添加到S3:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": "*",
"Action": "*",
"Resource": [
"arn:aws:s3:::repo.eu-west-1.amazonaws.com",
"arn:aws:s3:::repo.eu-west-1.amazonaws.com/*"
]
}
]
}
Run Code Online (Sandbox Code Playgroud)
将eu-west-1替换为S3端点所在的相关区域代码.
许多亚马逊EC2的首次使用者遇到了这个问题.根据我的经验,通常是不在其实例的安全组上设置允许的传出连接的结果.亚马逊用于配置Amazon Linux实例的教程仅提及设置传入连接,因此很容易忘记您从未设置允许的传出连接.只需允许HTTP和HTTPS请求任何IP地址就可以解决问题.
我有同样的问题,并且与名称解析有关。我使用以下方法来更正:
这是Mat的很好解释:
| 归档时间: |
|
| 查看次数: |
57417 次 |
| 最近记录: |