阿里云ECS服务器 Centos7.2 使用 yum 安装 ansible 报错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了阿里云ECS服务器 Centos7.2 使用 yum 安装 ansible 报错相关的知识,希望对你有一定的参考价值。

#####################使用阿里云的ECS服务器Centos7.2系统安装ansible提示安装不上###########
原因
通过Yum安装最新发布版本
通过Yum安装RPMs适用于 EPEL 6, 7, 以及仍在支持中的Fedora发行版.
托管节点的操作系统版本可以是更早的版本(如 EL5), 但必须安装 Python 2.4 或更高版本的Python.
Fedora 用户可直接安装Ansible, 但RHEL或CentOS用户,需要 配置 EPEL
连接地址:https://fedoraproject.org/wiki/EPEL
配置EPEL
技术分享图片
点击epel-release-latest-7 即可下载到本地。

将此rpm包安装上传到服务器中,直接安装
#yum clean all
#yum makecache

提示如下错误:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
ansible-2.6.4-1.el7.noarch.rpm FAILED
http://mirrors.aliyun.com/epel/7/x86_64/Packages/a/ansible-2.6.4-1.el7.noarch.rpm: [Errno 14] HTTP Error 404 - Not Found
Trying other mirror.
To address this issue please refer to the below wiki article
https://wiki.centos.org/yum-errors
If above article doesn‘t help to resolve this issue please use https://bugs.centos.org/.
Error downloading packages:
ansible-2.6.4-1.el7.noarch: [Errno 256] No more mirrors to try.
原因:是因为配置 epel.repo 源的问题
调整方法:
#cd /etc/yum.repos.d/
# mv epel.repo epel.repo.bak

#yum clean all
#yum makecache

Metadata Cache Created
$ sudo yum -y install ansible
Complete!
###########################################解决###################################################

以上是关于阿里云ECS服务器 Centos7.2 使用 yum 安装 ansible 报错的主要内容,如果未能解决你的问题,请参考以下文章

阿里云ECS服务器安装LNMP环境

怎么使用阿里云ecs设置网站首页

阿里云服务器ecs怎么使用

阿里云ecs能搭建haproxy+keepalive吗

阿里云的服务器ecs怎么配置

阿里云服务器ECS选型购买参照