Bug 709225

Summary: yum doesn't update from noarch to arch package and vice versa
Product: Red Hat Enterprise Linux 6 Reporter: Karel Srot <ksrot>
Component: yumAssignee: Zdeněk Pavlas <zpavlas>
Status: CLOSED NOTABUG QA Contact: Karel Srot <ksrot>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: jzeleny, lockhart, mnowak, pknirsch, zpavlas
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-11-01 15:11:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Karel Srot 2011-05-31 06:19:05 UTC
Description of problem:

Yum doesn't update the noarch package with newer arch package and vice versa.

[root@dhcp-30-102 devel]# ls dummy-pkg*.rpm
dummy-pkg-1.0-1.noarch.rpm  dummy-pkg-1.0-2.x86_64.rpm  dummy-pkg-1.0-3.noarch.rpm
[root@dhcp-30-102 devel]# rpm -i dummy-pkg-1.0-1.noarch.rpm
[root@dhcp-30-102 devel]# yum --nogpgcheck -y localinstall dummy-pkg-1.0-2.x86_64.rpm
Loaded plugins: aliases, auto-update-debuginfo, changelog, priorities, product-id, refresh-packagekit,
              : rhnplugin, security, subscription-manager, tsflags
Updating Red Hat repositories.
Setting up Local Package Process
Examining dummy-pkg-1.0-2.x86_64.rpm: dummy-pkg-1.0-2.x86_64
Marking dummy-pkg-1.0-2.x86_64.rpm as an update to dummy-pkg-1.0-1.noarch
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Nothing to do
[root@dhcp-30-102 devel]# rpm -e dummy-pkg
[root@dhcp-30-102 devel]# rpm -i dummy-pkg-1.0-2.x86_64.rpm 
[root@dhcp-30-102 devel]# yum --nogpgcheck -y localinstall dummy-pkg-1.0-3.noarch.rpm 
Loaded plugins: aliases, auto-update-debuginfo, changelog, priorities, product-id, refresh-packagekit,
              : rhnplugin, security, subscription-manager, tsflags
Updating Red Hat repositories.
Setting up Local Package Process
Examining dummy-pkg-1.0-3.noarch.rpm: dummy-pkg-1.0-3.noarch
Marking dummy-pkg-1.0-3.noarch.rpm as an update to dummy-pkg-1.0-2.x86_64
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Nothing to do



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

How reproducible:
always

Steps to Reproduce:
1. see above
  
Actual results:
package is not updated

Expected results:
package is updated

Additional info:
Not working with yum-3.2.27-14.el6
Working with RHEL5 yum

Comment 2 Karel Srot 2011-09-29 14:04:43 UTC
I am not sure whether I understand how yum works or should work.
I tried to add Obsoletes  into the spec file, in particular I use:

[root@dhcp-30-102 tmp.5LQCBkyVNw]# cat dummy-bz709225-1.specSummary: dummy-bz709225 Package
Name: dummy-bz709225
Version: 1.0
Release: 1
Group: System Environment/Base
License: GPL
BuildArch: noarch
Provides: dummy-bz709225

%description

This is a dummy-bz709225 test package

%files

[root@dhcp-30-102 tmp.5LQCBkyVNw]# cat dummy-bz709225-2.spec
Summary: dummy-bz709225 Package
Name: dummy-bz709225
Version: 1.0
Release: 2
Group: System Environment/Base
License: GPL
BuildArch: x86_64
Provides: dummy-bz709225
Obsoletes: dummy-bz709225 < 1.0-2

%description

This is a dummy-bz709225 test package

%files
[root@dhcp-30-102 tmp.5LQCBkyVNw]# cat dummy-bz709225-3.spec
Summary: dummy-bz709225 Package
Name: dummy-bz709225
Version: 1.0
Release: 3
Group: System Environment/Base
License: GPL
BuildArch: noarch
Provides: dummy-bz709225
Obsoletes: dummy-bz70922 < 1.0-3

%description

This is a dummy-bz709225 test package

%files


Then I build all packages. update from dummy-bz709225-1.0-1 to dummy-bz709225-1.0-2 works fine, but another update fails (maybe I am using obsoletes in a wrong way).

You can try:

# rpm -i dummy-bz709225-1.0-2

Now 

# yum localinstall /root/rpmbuild/RPMS/noarch/dummy-bz709225-1.0-3.noarch.rpm
Loaded plugins: product-id, refresh-packagekit, rhnplugin, subscription-manager
Updating certificate-based repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Setting up Local Package Process
Examining /root/rpmbuild/RPMS/noarch/dummy-bz709225-1.0-3.noarch.rpm: dummy-bz709225-1.0-3.noarch
Marking /root/rpmbuild/RPMS/noarch/dummy-bz709225-1.0-3.noarch.rpm as an update to dummy-bz709225-1.0-2.x86_64
Nothing to do


BUT:

# mkdir /tmp/repo && cp dummy-bz709225-1.0-3.noarch.rpm /tmp/repo && createrepo /tmp/repo
# cat > /etc/yum.repos.d/test.repo <<EOF
[test]
name=test
gpgcheck=0
enabled=1
baseurl=file:///tmp/repo
EOF

# yum localinstall /tmp/repo/dummy-bz709225-1.0-3.noarch.rpm 
Loaded plugins: product-id, refresh-packagekit, rhnplugin, subscription-manager
Updating certificate-based repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Setting up Local Package Process
Examining /tmp/repo/dummy-bz709225-1.0-3.noarch.rpm: dummy-bz709225-1.0-3.noarch
Marking /tmp/repo/dummy-bz709225-1.0-3.noarch.rpm as an update to dummy-bz709225-1.0-2.x86_64
Resolving Dependencies
--> Running transaction check
---> Package dummy-bz709225.x86_64 0:1.0-2 will be updated
---> Package dummy-bz709225.noarch 0:1.0-3 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================
 Package                   Arch              Version          Repository                               Size
============================================================================================================
Updating:
 dummy-bz709225            noarch            1.0-3            /dummy-bz709225-1.0-3.noarch            0.0  

Transaction Summary
============================================================================================================
Upgrade       1 Package(s)

Is this ok [y/N]: 
Exiting on user Command

AND

# yum --disablerepo=test localinstall /tmp/repo/dummy-bz709225-1.0-3.noarch.rpm 
Loaded plugins: product-id, refresh-packagekit, rhnplugin, subscription-manager
Updating certificate-based repositories.
This system is not registered with RHN.
RHN Satellite or RHN Classic support will be disabled.
Setting up Local Package Process
Examining /tmp/repo/dummy-bz709225-1.0-3.noarch.rpm: dummy-bz709225-1.0-3.noarch
Marking /tmp/repo/dummy-bz709225-1.0-3.noarch.rpm as an update to dummy-bz709225-1.0-2.x86_64
Nothing to do


To sum it up: Update arch->noarch works for packages in repo and packages locally installed which are also available in some repo - but doesn't work for localinstall (only) package.

Comment 5 Karel Srot 2011-11-01 14:50:30 UTC
Zdenek found a typo in my spec file. I can confirm that packages are updated properly when using Obsoletes in SPEC.

Thank you, I think this bug can be closed.

Comment 6 James Antill 2012-11-02 14:49:41 UTC
*** Bug 727606 has been marked as a duplicate of this bug. ***