29

How do I disable yum transaction check for a file ?

Transaction check error:
  file /usr/local/xenco/backend/current from install of xenco-rr-1.9.6-104.x86_64 conflicts with file from package xenco-server-1.9.6-104.x86_64
Chucks
  • 899
  • 3
  • 13
  • 29

4 Answers4

35

Replacing files from another RPM package is bad idea in most cases and I strongly advise against what you're trying to do. That said, apply following at your own risk.

Yum does not provide an option to install conflicting files, I think. However, that does not prevent you from installing a RPM package with rpm(1) which does provide an option to override existing files from another package, namely --replacefiles.

So, first get the RPM of the package you want to install on a local filesystem (/usr/local/xenco... makes me suspect that is the case already). Next install the RPM with rpm -i --replacefiles <your_rpm_file>.

John Topley
  • 113,588
  • 46
  • 195
  • 237
  • 7
    +1 for actually providing answer on how to do that. while this may be a "bad idea" in some cases, there are also cases where it's not a bad idea at all, just a bad packaging by vendor and overwriting does nothing bad. – Petr Feb 23 '17 at 08:00
  • note that `--replacefiles` has just the same meaning as `--force` – poige Jan 18 '23 at 13:29
  • What do you recommend instead, erasing the old package and installing the new like suggested in [this answer](https://stackoverflow.com/a/67324984/2147927)? – Line Apr 18 '23 at 10:59
12

This method worked for me, when I faced similar issue

Simply get the existing package with below command

rpm -qa | grep xenco

Remove those conflicting package with

yum remove packageNameFromTheList
Muthukumar Anbalagan
  • 1,138
  • 12
  • 15
  • yum remove compat-mysql51-5.1.73-1.el6.remi.x86_64 (this was an ancient unwanted leftover preventing yum update of mysql-community-server) – zzapper Oct 12 '18 at 10:37
6

what i always do is remove the package that is on the right hand side. In your case it would be -

yum remove xenco-server-1.9.6-104.x86_64

yum remove <> can work with any package error, i have encountered many such transactions errors when working on vm on cloud, i always remove the package that causes conflicts and always has worked for me.

Prajwal
  • 71
  • 1
  • 4
4

My two cents:

yum erase ${old_package}
yum install ${new_package_with_same_files}

The exclusion of --replacefiles is intentional. Yum is a package manager, let it manage the packages.

(This answer adds a yum-only solution to the accepted answer.)

Chaim Eliyah
  • 2,743
  • 4
  • 24
  • 37
  • 2
    You can also use `yum swap -- remove xenco-server -- install xenco-rr` if you have many dependencies and you don't want to uninstall everything. – Antoine Viallon Nov 17 '22 at 09:41