首先,根据我自己搜索查到的有关于这个 ‘conflicts with file from package’错误的发生一般有两种情况。
第一种是在使用rpm安装的时候。网上有相关的解决方法:
https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-rpm-conflicting-files.html
To make RPM ignore this error, use the --replacefiles
option:
rpm -ivh --replacefiles foo-1.0-1.i386.rpm
就是在rpm -ivh 的命令后面加上 --replacefiles 这个参数。
第二种情况,是我自己遇到的,在yum 安装到时候。
错误:
'''
# yum install mysql
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirror.neu.edu.cn
* extras: centos.ustc.edu.cn
* updates: ftp.sjtu.edu.cn
http://downloads.paradigm4.com/centos6.3/14.12/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
Trying other mirror.
Package mysql is obsoleted by mysql-community-client, trying to install mysql-community-client-5.5.48-2.el6.x86_64 instead
Resolving Dependencies
--> Running transaction check
---> Package MySQL-client.x86_64 0:5.5.48-1.linux2.6 will be obsoleted
---> Package mysql-community-client.x86_64 0:5.5.48-2.el6 will be obsoleting
--> Processing Dependency: mysql-community-libs(x86-64) = 5.5.48-2.el6 for package: mysql-community-client-5.5.48-2.el6.x86_64
--> Running transaction check
---> Package MySQL-shared.x86_64 0:5.5.48-1.el6 will be obsoleted
---> Package mysql-community-libs.x86_64 0:5.5.48-2.el6 will be obsoleting
--> Processing Dependency: mysql-community-common(x86-64) = 5.5.48-2.el6 for package: mysql-community-libs-5.5.48-2.el6.x86_64
---> Package mysql-libs.x86_64 0:5.1.73-5.el6_6 will be obsoleted
--> Processing Dependency: libmysqlclient.so.16()(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Processing Dependency: libmysqlclient.so.16(libmysqlclient_16)(64bit) for package: 2:postfix-2.6.6-6.el6_5.x86_64
--> Running transaction check
---> Package mysql-community-common.x86_64 0:5.5.48-2.el6 will be installed
---> Package mysql-community-libs-compat.x86_64 0:5.5.48-2.el6 will be obsoleting
---> Package postfix.x86_64 2:2.6.6-6.el6_5 will be updated
---> Package postfix.x86_64 2:2.6.6-6.el6_7.1 will be an update
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Installing:
mysql-community-client x86_64 5.5.48-2.el6 mysql55-community 14 M
replacing MySQL-client.x86_64 5.5.48-1.linux2.6
mysql-community-libs x86_64 5.5.48-2.el6 mysql55-community 1.7 M
replacing MySQL-shared.x86_64 5.5.48-1.el6
replacing mysql-libs.x86_64 5.1.73-5.el6_6
mysql-community-libs-compat x86_64 5.5.48-2.el6 mysql55-community 1.6 M
replacing mysql-libs.x86_64 5.1.73-5.el6_6
Installing for dependencies:
mysql-community-common x86_64 5.5.48-2.el6 mysql55-community 277 k
Updating for dependencies:
postfix x86_64 2:2.6.6-6.el6_7.1 updates 2.0 M
Transaction Summary
=============================================================================================================================
Install 4 Package(s)
Upgrade 1 Package(s)
Total size: 20 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Check Error:
file /usr/bin/mysql_config from install of mysql-community-client-5.5.48-2.el6.x86_64 conflicts with file from package MySQL-devel-5.5.48-1.el6.x86_64
Error Summary
-------------
'''
这是因为在之前的用rpm的安装包安装了一次,结果发现不行,然后换成修改yum的源的方法安装,出现了这样的错误。
解决方案:
#yum -y remove MySQL-devel-5.5.48-1.el6.x86_64
上面那个绿色的部分原封不动复制下来就OK。
这样就卸了那个发生冲突的部分了。
结果:
# yum -y remove MySQL-devel-5.5.48-1.el6.x86_64
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package MySQL-devel.x86_64 0:5.5.48-1.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
=============================================================================================================================
Package Arch Version Repository Size
=============================================================================================================================
Removing:
MySQL-devel x86_64 5.5.48-1.el6 installed 20 M
Transaction Summary
=============================================================================================================================
Remove 1 Package(s)
Installed size: 20 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Erasing : MySQL-devel-5.5.48-1.el6.x86_64 1/1
Verifying : MySQL-devel-5.5.48-1.el6.x86_64 1/1
Removed:
MySQL-devel.x86_64 0:5.5.48-1.el6
Complete!
接下来安装就没有冲突了