1. 程式人生 > >SaltStack安裝時python版本沖突導致安裝失敗

SaltStack安裝時python版本沖突導致安裝失敗

saltstack 自動化運維 linux 集群 python

yum -y install salt-master 安裝時,出現以下報錯:

 file /usr/lib64/python2.6/zipfile.pyc from install of python-libs-2.6.6-66.el6_8.x86_64 conflicts with file from package python-2.6.6-36.el6.x86_64
  file /usr/lib64/python2.6/zipfile.pyo from install of python-libs-2.6.6-66.el6_8.x86_64 conflicts with file from package python-2.6.6-36.el6.x86_64

從報錯信息中可以發現conflicts,這是沖突的意思,即python-libs-2.6.6-66.el6_8.x86_64與python-2.6.6-36.el6.x86_64發生沖突;

查詢發現系統已經安裝了2.6.6-26版本

[root@m01 ~]# rpm -q python-libs
python-libs-2.6.6-36.el6.x86_64
[root@m01 ~]# rpm -q python
python-2.6.6-36.el6.x86_64

而yum安裝salt-master的版本是2015.5.10-2.el6 ,需要python-libs-2.6.6-66.el6.x86_64

版本,因此導致發生沖突

python-libs-2.6.6-66.el6_8.x86_6
python-2.6.6-36.el6.x86_64

嘗試卸載發生沖突的包然後安裝需要的版本,可以發現卸載不了,這個包被其它包依賴,受保護,不能卸載
yum -y remove python-2.6.6-36.el6.x86_64

Error: Trying to remove "yum", which is protected
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

換個思維,那我是否可以升級

yum -y update  python-2.6.6-36.el6.x86_64
[root@m01 ~]# rpm -qa python-libs  
python-libs-2.6.6-66.el6_8.x86_64
[root@m01 ~]# rpm -qa python
python-2.6.6-66.el6_8.x86_64

升級後果然可以安裝salt-master了

SaltStack安裝時python版本沖突導致安裝失敗