使用yum源自带包安装Ansible失败,Error: Package: ansible-2.6.13-1.el6.noarch (epel) Requires: python-simplejson

使用yum源安装Ansible报以下错误:

Error: Package: ansible-2.6.13-1.el6.noarch (epel)
Requires: python-simplejson
Error: Package: ansible-2.6.13-1.el6.noarch (epel)
Requires: python(abi) = 2.6
Installed: python-2.7.5-76.el7.x86_64 (@base)
python(abi) = 2.7
python(abi) = 2.7
Available: python-2.7.5-77.el7_6.x86_64 (updates)
python(abi) = 2.7
python(abi) = 2.7
Available: python34-3.4.8-1.el6.i686 (epel)
python(abi) = 3.4
Error: Package: python-jinja2-26-2.6-3.el6.noarch (epel)
Requires: python(abi) = 2.6
Installed: python-2.7.5-76.el7.x86_64 (@base)
python(abi) = 2.7
python(abi) = 2.7
Available: python-2.7.5-77.el7_6.x86_64 (updates)
python(abi) = 2.7
python(abi) = 2.7
Available: python34-3.4.8-1.el6.i686 (epel)
python(abi) = 3.4
Error: Package: python-crypto2.6-2.6.1-2.el6.x86_64 (epel)
Requires: libpython2.6.so.1.0()(64bit)
Error: Package: ansible-2.6.13-1.el6.noarch (epel)
Requires: /usr/bin/python2.6
Error: Package: python-crypto2.6-2.6.1-2.el6.x86_64 (epel)
Requires: python(abi) = 2.6
Installed: python-2.7.5-76.el7.x86_64 (@base)
python(abi) = 2.7
python(abi) = 2.7
Available: python-2.7.5-77.el7_6.x86_64 (updates)
python(abi) = 2.7
python(abi) = 2.7
Available: python34-3.4.8-1.el6.i686 (epel)
python(abi) = 3.4
You could try using --skip-broken to work around the problem
** Found 3 pre-existing rpmdb problem(s), 'yum check' output follows:
1:logstash-6.2.4-1.noarch is a duplicate with 1:logstash-2.3.4-1.noarch
php-bcmath-5.4.45-13.el7.remi.x86_64 has missing requires of php-common(x86-64) = ('0', '5.4.45', '13.el7.remi')
php-mbstring-5.4.45-13.el7.remi.x86_64 has missing requires of php-common(x86-64) = ('0', '5.4.45', '13.el7.remi')

原因:epel源与python版本冲突原因,从上图可以看出,有些包是需要依赖python2.6的版本,此主机的python版本是2.7.5。

解决办法:

1、先卸载 epel-release源,

#yum  install  epel-release  -y

2、到 /etc/yum.repos.d 目录下,将epel.repo源备份,

#mv  epel.repo  epel.repo.bak

3、清理yum源缓存和新建缓存,

# yum clean all

# yum makecache

4、再执行安装命令:#yum  install  ansible  -y

5、#ansible  --version 

 检测Ansible安装是否成功,输出下图所示,则表示成功。

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值