解决rpm conflicts with file from package问题

[root@harbor opt]# rpm -ivh python27-2.7.9-1.x86_64.rpm
准备中...                          ################################# [100%]
    file /usr/bin/python2.7 from install of python27-2.7.9-1.x86_64 conflicts with file from package python-2.7.5-76.el7.x86_64
    file /usr/share/man/man1/python2.7.1.gz from install of python27-2.7.9-1.x86_64 conflicts with file from package python-2.7.5-76.el7.x86_64
    file /usr/bin/python2.7-config from install of python27-2.7.9-1.x86_64 conflicts with file from package python-devel-2.7.5-76.el7.x86_64
    file /usr/include/python2.7/pyconfig.h from install of python27-2.7.9-1.x86_64 conflicts with file from package python-devel-2.7.5-76.el7.x86_64

方法一

yum -y remove python-2.7.5-76.el7.x86_64
卸载掉冲突的文件,安装新的文件。如果由于由于依赖关系导致要卸载很多软件,那可以优先考虑下一个方法。

方法二

rpm -ivh python27-2.7.9-1.x86_64.rpm --replacefiles
安装的时候增加--replacefiles参数,但是不知道在yum里如何实现。

--replacepkgs 强制重新安装已经安装的软件包
--replacefiles 替换属于其它软件包的文件
rpm -e --nodeps python27-2.7.9-1.x86_64.rpm 强制删除包

转载于:https://www.cnblogs.com/robert871126/p/10772877.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值