Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 231022 - yum overwrites conflicting files instead of failing
Summary: yum overwrites conflicting files instead of failing
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 6
Hardware: i386
OS: Linux
medium
high
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL: http://bugs.centos.org/view.php?id=1725
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-03-05 17:23 UTC by Jack Perdue
Modified: 2015-10-03 16:25 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-03-13 10:46:59 UTC


Attachments (Terms of Use)

Description Jack Perdue 2007-03-05 17:23:52 UTC
Description of problem:

If two packages (inadvertantly) have a common file, yum will allow both
to be installed and will overwrite the first installed packaage's file(s)
with the second package's file(s). 

Version-Release number of selected component (if applicable):

yum-2.4.1-1.fc4 on FC4 and yum-2.6.1-0.fc5 on FC5

How reproducible:

Very.

Steps to Reproduce:

I have the following foo.spec:

$ cat foo.spec
Name: foo
Summary: test case for yum bug
Version: 0
Release: 1
License: GPL
Group: Development/Tools
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description
foo

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/usr/bin
echo "echo foo" > %{buildroot}/usr/bin/fubar.sh
chmod 755 %{buildroot}/usr/bin/fubar.sh

%clean
rm -rf %{buildroot}

%files
%{_bindir}/fubar.sh

I create bar.spec with:

  cat foo.spec | sed 's/foo/bar/g' > bar.spec

then I build RPMs for them:

  rpmbuild -ba foo.spec bar.spec

now I have two RPMs that share the file /usr/bin/fubar.sh.

I then drop it into my local repo and run createrepo to update.

Then, on a system that uses that repo, I do:

 yum install foo
 yum install bar

yum issues absolutely no warning/error and happily overwrites foo's fubar.sh
with bar's fubar.sh. 
  
Actual results:

$ /usr/bin/fubar.sh
bar
$ rpm -V bar
$ rpm -V foo
..5..... /usr/bin/fubar.sh

Expected results:

Failure to install foo along the lines of:

Transaction Check Error: file /usr/bin/fubar.sh from install of bar-0-1
conflicts with file from package foo-0-1

Additional info:

This was originally reported to CentOS here:

  http://bugs.centos.org/view.php?id=1725

Testing by the CentOS maintainer indicates this doesn't happen 
with yum.x86_64, but does with yum.i386.  See the CentOS report
for details.

Comment 1 Paul Nasrat 2007-03-13 10:46:59 UTC
Testing on i386:

sudo rpm -ivh --test ../RPMS/testfoo-0-1.i386.rpm ../RPMS/testbar-0-1.i386.rpm 
Preparing...                ########################################### [100%]
        file /usr/bin/fubar.sh conflicts between attempted installs of
testfoo-0-1 and testbar-0-1

yum localinstall testfoo.rpm testbar.rpm
Transaction Check Error:   file /usr/bin/fubar.sh conflicts between attempted
installs of testfoo-0-1 and testbar-0-1

rpm -ivh testfoo.rpm and use yum localinstall testbar.rpm:

Transaction Check Error:   file /usr/bin/fubar.sh from install of testbar-0-1
conflicts with file from package testfoo-0-1



Comment 2 Marcin Deranek 2008-07-16 10:18:27 UTC
That's correct as:

bash# yum -d 0 -y localinstall foo-0-1.i386.rpm bar-0-1.i386.rpm 

Transaction Check Error:   file /usr/bin/fubar.sh conflicts between attempted
installs of foo-0-1 and bar-0-1

But:

bash# yum -d 0 -y localinstall foo-0-1.i386.rpm 
bash# yum -d 0 -y localinstall bar-0-1.i386.rpm 
bash# echo $?
0
bash# rpm -q -f /usr/bin/fubar.sh
foo-0-1
bar-0-1

I got these results on i386 with yum-2.6.1

Comment 3 seth vidal 2008-07-17 16:37:53 UTC
The only thing I can tell you here is to upgrade:

1. fc6 hasn't been supported in quite some time, now
2. yum 2.6.1 is ancient



Comment 4 sigdkc 2015-10-03 16:25:56 UTC
When yum gets a TransactionSet from rpm, it has a variable that yum expects to be zero but isn't. You can set it to zero directly after creating a TransactionSet:

--- yum-2.4.3/rpmUtils/transaction.py	2005-03-27 06:42:09.000000000 +0200
+++ yum-2.4.3p/rpmUtils/transaction.py	2015-10-03 01:30:23.000000000 +0200
@@ -41,6 +41,7 @@
                          'next',
                          'clean']
         self.tsflags = []
+        self.ts.setProbFilter(0)
 
     def __getattr__(self, attr):
         if attr in self._methods:


Note You need to log in before you can comment on or make changes to this bug.