使用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安裝是否成功,輸出下圖所示,則表示成功。