Amazon web services Amazon EC2实例可以';t更新或使用yum或up2date命令
我正在使用亚马逊的教程。前几条说明涉及使用Amazon web services Amazon EC2实例可以';t更新或使用yum或up2date命令,amazon-web-services,amazon-ec2,yum,Amazon Web Services,Amazon Ec2,Yum,我正在使用亚马逊的教程。前几条说明涉及使用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: Timeo
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
加载的插件:优先级、更新motd、升级助手
无法检索镜像列表http://repo.us-east-1.amazonaws.com/latest/main/mirror.list 错误是
12:上的超时http://repo.us-east-1.amazonaws.com/latest/main/mirror.list: (28,“连接在10001毫秒后超时”)
其中一个配置的存储库失败(未知),
而且yum没有足够的缓存数据继续。在这一点上,唯一的
百胜可以做的安全事情就是失败。有几种方法可以“修复”此问题:
1.联系上游的存储库,让他们解决问题。
2.为存储库重新配置baseurl/etc,以指向工作
上游如果您使用的是较新的
存储库(以及
上一个发行版的包仍然有效)。
3.禁用存储库,以便默认情况下yum不会使用它。那么百胜将
只需忽略存储库,直到您再次永久启用或使用它
--临时使用的enablerepo:
yum配置管理器--禁用
4.如果失败的存储库不可用,请将其配置为跳过。
请注意,yum将尝试联系repo。当它运行大多数命令时,
因此,每次都必须尝试失败(因此,百胜将是非常重要的)
较慢)。如果这是一个非常暂时的问题,这通常是一个很好的解决方案
妥协:
yum config manager--save--setopt=.skip_if_unavailable=true
找不到repo:amzn main/latest的有效baseurl
我以前也做过同样的事情,没有遇到任何问题,使用相同的教程,但那是几个月前的事了。我不知道发生了什么变化,但我微薄的经验让我无法找到答案。看起来主机在联系百胜服务器时遇到了问题。确保实例具有出站internet访问权限(检查安全组等)。如果实例位于VPC中,且安全组看起来不错,则可能需要使用nat设备或连接弹性IP
祝你好运-只需将默认安全组与您可能创建的安全组一起分配即可。这解决了我的问题 很多首次使用亚马逊EC2的用户都会遇到这个问题。根据我的经验,这通常是因为没有在实例的安全组上设置允许的传出连接。Amazon配置Amazon Linux实例的教程只提到设置传入连接,因此很容易忘记您从未设置允许的传出连接。只要允许
HTTP
和HTTPS
请求到任何IP地址,就可以解决这个问题 我也有同样的问题,与名字解析有关。我使用以下方法来更正:
这是Mat的一个很好的解释:
- 请访问console.aws.amazon.com
- 转到服务->专有网络
- 打开您的VPC
- 选择连接到EC2的专有网络,然后
- 编辑摘要--->将DNS主机名更改为“是”
{
"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/*"
]
}
]
}
将eu-west-1替换为S3端点所在的相关地区代码。替换为chadneal的注释。
有必要将DNS解析设置为是
- 请访问console.aws.amazon.com
- 转到服务->专有网络
- 打开您的VPC
- 选择连接到EC2的专有网络
- 单击编辑DNS解析并将其设置为是
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=5
bugtracker_url=http://bugs.centos.org/set_project.php?project_id=23&ref=http://bugs.centos.org/bug_report_page.php?category=yum
distroverpkg=centos-release
#proxy=http://pos-proxy-in-my-way-of-doing-actual-real-work:666
nameserver 8.8.8.8
nameserver 8.8.4.4
yum-config-manager --disable <repoid>
yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true