使用yum源安装Ansible报如下错误:php
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')python
缘由:epel源与python版本冲突缘由,从上图能够看出,有些包是须要依赖python2.6的版本,此主机的python版本是2.7.5。json
解决办法:缓存
一、先卸载 epel-release源,ui
#yum install epel-release -yspa
二、到 /etc/yum.repos.d 目录下,将epel.repo源备份,blog
#mv epel.repo epel.repo.bakip
三、清理yum源缓存和新建缓存,rem
# yum clean allstring
# yum makecache
四、再执行安装命令:#yum install ansible -y
五、#ansible --version
检测Ansible安装是否成功,输出下图所示,则表示成功。