Bug 604080

Summary: yum allows to install package obsoleted by installed package
Product: Red Hat Enterprise Linux 6 Reporter: Šimon Lukašík <slukasik>
Component: yumAssignee: James Antill <james.antill>
Status: CLOSED CURRENTRELEASE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: low Docs Contact:
Priority: low    
Version: 6.0CC: npajkovs
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.2.27-12.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-11-15 14:53:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 582655    
Attachments:
Description Flags
test-obsoleted-0.1-1.i386.rpm
none
test-obsoletes-0.1-1.i386.rpm none

Description Šimon Lukašík 2010-06-15 11:34:07 UTC
Description of problem:
Yum allows to install package that is obsoleted by currently installed package. Yum allows to install both even in single transaction.

Changelog of yum-3.2.24 says: 'Yum will now refuse to install a package that is obsoleted by a package that is currently installed.' ( http://yum.baseurl.org/wiki/whatsnew/3.2.24 )

Version-Release number of selected component (if applicable):
yum-3.2.27-9.el6.noarch

How reproducible:
always

Steps to Reproduce:
1. Take 2 packages (one obsoletes other)
test-obsoleted-0.1-1.i386.rpm
test-obsoletes-0.1-1.i386.rpm
2. rpm -qp --obsoletes test-obsoletes-0.1-1.i386.rpm
test-obsoleted
3. yum -y --nogpgcheck localinstall test-obsoletes-0.1-1.i386.rpm
4. yum -y --nogpgcheck localinstall test-obsoleted-0.1-1.i386.rpm
# Both installed
5. yum -y erase test-obsoleted test-obsoletes
6. yum -y --nogpgcheck localinstall test-obsolete*
# Both installed

Actual results:
both packages installed

Expected results:
don't install 

Additional info:

Comment 1 Šimon Lukašík 2010-06-15 11:35:07 UTC
Created attachment 424125 [details]
test-obsoleted-0.1-1.i386.rpm

p = rpmfluff.SimpleRpmBuild('test-obsoleted', '0.1', '1')
p.make()

Comment 2 Šimon Lukašík 2010-06-15 11:35:35 UTC
Created attachment 424126 [details]
test-obsoletes-0.1-1.i386.rpm

p = rpmfluff.SimpleRpmBuild("test-obsoletes", '0.1', '1')
p.add_obsoletes('test-obsoleted')
p.make()

Comment 4 RHEL Program Management 2010-06-15 11:53:20 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.

Comment 5 James Antill 2010-06-15 14:56:38 UTC
Is it possible that you have a yum.conf without obsoletes=true set?

Because here I get:


% rpm -q gnome-packagekit --obsoletes
pirut < 1.3.31-2
% sudo yum localinstall /tmp/pirut-1.3.28-17.el5.noarch.rpm 
Setting up Local Package Process
Examining /tmp/pirut-1.3.28-17.el5.noarch.rpm: pirut-1.3.28-17.el5.noarch
Marking /tmp/pirut-1.3.28-17.el5.noarch.rpm to be installed
Nothing to do
% sudo yum in /tmp/pirut-1.3.28-17.el5.noarch.rpm --setopt=obsoletes=false
Setting up Install Process
Examining /tmp/pirut-1.3.28-17.el5.noarch.rpm: pirut-1.3.28-17.el5.noarch
Marking /tmp/pirut-1.3.28-17.el5.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package pirut.noarch 0:1.3.28-17.el5 set to be installed
--> Processing Dependency: python(abi) = 2.4 for package: pirut-1.3.28-17.el5.noarch
[...]

Comment 6 James Antill 2010-06-15 14:59:47 UTC
With the latest yum-utils installed you can do:


% yum-config-manager main | fgrep obs
obsoletes = True

Comment 7 seth vidal 2010-06-15 15:01:55 UTC
not just unset - but actually set to 0/False/no

b/c the default is True.

Comment 8 Šimon Lukašík 2010-06-15 15:53:15 UTC
Yes, I've got obsoletes option enabled.

# yum-config-manager main | fgrep obs
obsoletes = True

With reproducer in comment 5: I've got same correct behaviour = package pirut is obsoleted (and not installed)

Could it be related to that I've used these very simple packages test-obsolete* ? May I help somehow?

Comment 9 seth vidal 2010-06-15 16:12:12 UTC
Here's what I've seen:

if the obsoleted pkg is obsoleted by something in a repository- then yum gets the localinstall right and will not install the obsoleted pkg but tries to install the obsoleting pkg

if the obsoleted pkg is obsoleted by something that is already installed but NOT in a repo anywhere, yum doesn't get it right - it can't seem to see the obsoletes in the rpmdb and NOT in the pkgsack anywhere.

I'll look for the bug there.

Comment 10 James Antill 2010-06-15 16:34:15 UTC
n/m ... if I do:


% sudo yum --disablerepo='*' localinstall /tmp/pirut-1.3.28-17.el5.noarch.rpm 

...then it tries to install pirut.

Comment 11 seth vidal 2010-06-15 17:42:33 UTC
I just sent a patch upstream to fix this.

Comment 12 James Antill 2010-06-16 14:48:54 UTC
*** Bug 604622 has been marked as a duplicate of this bug. ***

Comment 14 releng-rhel@redhat.com 2010-11-15 14:53:01 UTC
Red Hat Enterprise Linux 6.0 is now available and should resolve
the problem described in this bug report. This report is therefore being closed
with a resolution of CURRENTRELEASE. You may reopen this bug report if the
solution does not work for you.