Bug 478880 - 'yum update' wants to upgrade kernel, 'yum list updates' can't find the update
Summary: 'yum update' wants to upgrade kernel, 'yum list updates' can't find the update
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: rawhide
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Seth Vidal
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-05 20:21 UTC by Valdis Kletnieks
Modified: 2014-01-21 23:07 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-07 05:41:49 UTC


Attachments (Terms of Use)

Description Valdis Kletnieks 2009-01-05 20:21:02 UTC
Description of problem:
'yum update' wants to update the kernel, even though 'yum list updates' doesn't see an update.

# rpm -q yum kernel
yum-3.2.20-8.fc11.noarch
kernel-2.6.29-0.6.rc0.git2.fc11.x86_64
kernel-2.6.29-0.7.rc0.git3.fc11.x86_64
kernel-2.6.29-0.9.rc0.git4.fc11.x86_64
# yum list --showduplicates 'kernel'
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Installed Packages
kernel.x86_64                 2.6.29-0.6.rc0.git2.fc11                 installed
kernel.x86_64                 2.6.29-0.7.rc0.git3.fc11                 installed
kernel.x86_64                 2.6.29-0.9.rc0.git4.fc11                 installed
Available Packages
kernel.x86_64                 2.6.29-0.9.rc0.git4.fc11                 rawhide  
# rpm -V kernel-2.6.29-0.9.rc0.git4.fc11.x86_64
.......T    /lib/modules/2.6.29-0.9.rc0.git4.fc11.x86_64/modules.alias.bin
.......T    /lib/modules/2.6.29-0.9.rc0.git4.fc11.x86_64/modules.dep.bin
.......T    /lib/modules/2.6.29-0.9.rc0.git4.fc11.x86_64/modules.symbols.bin
# yum list updates
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
# yum update
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Setting up Update Process
No Packages marked for Update

So far, so good.  But then....

# yum update 'k*'
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.29-0.9.rc0.git4.fc11 set to be installed
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:2.6.29-0.6.rc0.git2.fc11 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch         Version                        Repository       Size
================================================================================
Installing:
 kernel       x86_64       2.6.29-0.9.rc0.git4.fc11       rawhide          22 M
Removing:
 kernel       x86_64       2.6.29-0.6.rc0.git2.fc11       installed       176 M

Transaction Summary
================================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       1 Package(s)         

Total size: 22 M
Is this ok [y/N]: 
Exiting on user Command
Complete!

/etc/yum.conf has "installonly_limit=3" set.  So why is the 'k*' pulling up a match? (I double-checked, there's not even a file in the current directory starting with 'k', so it's not even a globbing issue).

Version-Release number of selected component (if applicable):
yum-3.2.20-8.fc11.noarch

How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
I found this issue while cherry-picking updates from rawhide (there's several RPMs that I don't want installed because they break my system (bugzillas filed already), but I hadn't listed in the 'exclude=' in yum.conf yet.

Comment 1 seth vidal 2009-01-05 20:33:30 UTC
so - just to be sure - are you positive you're not getting an updated mirror for rawhide which is causing the change, there?

Can you duplicate this running:

yum -C list updates
yum -C list kernel\*
yum -C update 'k*'

thanks

Comment 2 Valdis Kletnieks 2009-01-05 20:48:13 UTC
The odd part is that the version it wants to install (2.6.29-0.9.rc0.git4.fc11) is a version that's already installed (although if it wanted to install a newer kernel RPM than 'list updates' showed, that in itself would be odd enough).

# yum -C list updates
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
# yum -C list kernel\*
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Installed Packages
kernel.x86_64                     2.6.29-0.6.rc0.git2.fc11             installed
kernel.x86_64                     2.6.29-0.7.rc0.git3.fc11             installed
kernel.x86_64                     2.6.29-0.9.rc0.git4.fc11             installed
kernel-firmware.noarch            2.6.29-0.9.rc0.git4.fc11             installed
kernel-headers.x86_64             2.6.29-0.9.rc0.git4.fc11             installed
kerneloops.x86_64                 0.12-1.fc10                          installed
Available Packages
kernel-devel.x86_64               2.6.29-0.9.rc0.git4.fc11             rawhide  
kernel-doc.noarch                 2.6.29-0.9.rc0.git4.fc11             rawhide  
# yum -C update 'k*'
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.29-0.9.rc0.git4.fc11 set to be installed
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:2.6.29-0.6.rc0.git2.fc11 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch         Version                        Repository       Size
================================================================================
Installing:
 kernel       x86_64       2.6.29-0.9.rc0.git4.fc11       rawhide          22 M
Removing:
 kernel       x86_64       2.6.29-0.6.rc0.git2.fc11       installed       176 M

Transaction Summary
================================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       1 Package(s)         

Total size: 22 M
Is this ok [y/N]: 
Exiting on user Command
Complete!

The problem persists even after 'yum clean all':

# yum clean all
Loaded plugins: refresh-packagekit, refresh-updatesd
Cleaning up Everything
# yum list updates
Loaded plugins: refresh-packagekit, refresh-updatesd
rawhide                                                  | 2.8 kB     00:00     
rawhide/primary_db                                       | 8.6 MB     00:01     
Excluding Packages in global exclude list
Finished
# yum update
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Setting up Update Process
No Packages marked for Update
# yum update 'k*'
Loaded plugins: refresh-packagekit, refresh-updatesd
Excluding Packages in global exclude list
Finished
Setting up Update Process
Resolving Dependencies
--> Running transaction check
---> Package kernel.x86_64 0:2.6.29-0.9.rc0.git4.fc11 set to be installed
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:2.6.29-0.6.rc0.git2.fc11 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
 Package      Arch         Version                        Repository       Size
================================================================================
Installing:
 kernel       x86_64       2.6.29-0.9.rc0.git4.fc11       rawhide          22 M
Removing:
 kernel       x86_64       2.6.29-0.6.rc0.git2.fc11       installed       176 M

Transaction Summary
================================================================================
Install      1 Package(s)         
Update       0 Package(s)         
Remove       1 Package(s)         

Total download size: 22 M
Is this ok [y/N]: 
Exiting on user Command
Complete!

Comment 3 James Antill 2009-01-05 21:01:06 UTC
I can reporoduce this:

% sudo yum list updates kernel
Error: No matching Packages to list
% sudo yum install kernel
Package kernel-2.6.27.9-73.fc9.x86_64 already installed and latest version
Nothing to do
% sudo yum update kernel
--> Running transaction check
---> Package kernel.x86_64 0:2.6.27.9-73.fc9 set to be installed
--> Finished Dependency Resolution
--> Running transaction check
---> Package kernel.x86_64 0:2.6.27.5-41.fc9 set to be erased
--> Finished Dependency Resolution
[...]

Comment 4 James Antill 2009-01-05 21:12:21 UTC
 This works for me:

diff --git a/yum/__init__.py b/yum/__init__.py
index e4ec245..47f16ee 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2727,7 +2727,8 @@ class YumBase(depsolve.Depsolve):
                     availpkgs = self._compare_providers(availpkgs, requiringPo)
                     availpkgs = map(lambda x: x[0], availpkgs)
 
-       
+        # Remove pacakges that are installed, from the available list.
+        availpkgs = filter(lambda po: not self.rpmdb.contains(po=po), availpkgs
         # for any thing specified
         # get the list of available pkgs matching it (or take the po)
         # get the list of installed pkgs matching it (or take the po)

Comment 5 James Antill 2009-01-05 21:13:50 UTC
insert obviously missing ) on the end of the line, due to copy and paste there.

Comment 6 Valdis Kletnieks 2009-01-05 22:08:51 UTC
I see why adding that filter would make the issue go away - but do we understand yet *why* it thinks a kernel upgrade is called for?  My first guess is that it doesn't handle 'installonly' targets well, and sees that the (already installed) version is an upgrade from some other already installed version.  But then, why doesn't it pop up on 'yum update', but only when there's package matching going on?

Comment 7 James Antill 2009-01-06 00:21:54 UTC
> but do we understand yet *why* it thinks a kernel upgrade is called for?

 Well at that point it only looks at what is available, we assume that later on something used to reject it for things that were already installed.
 I assume either Seth or I broke that fixing something else (or adding reinstall, etc.) ... we're trying to work it out, and something different my well go upstream. But atm. the above wfm(tm).

> But then, why doesn't it pop up on 'yum update', but only when
> there's package matching going on?

 Atm. "yum update" is a specific code path.

Comment 8 seth vidal 2009-01-06 05:10:27 UTC
This is a bit more targetted, I think..

index 27eb5c2..21cc0ef 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2815,7 +2815,10 @@ class YumBase(depsolve.Depsolve):
             #        it to of what is installed. in the meantime name.arch is
             #        most likely correct
             pot_updated = self.rpmdb.searchNevra(name=available_pkg.name, arch=available_pkg.arch)
-            for ipkg in pot_updated:
+            # only compare against the newest of what's installed
+            if pot_updated:
+                pot_updated.sort()
+                ipkg = pot_updated[-1]
                 if self.tsInfo.isObsoleted(ipkg.pkgtup):
                     self.verbose_logger.log(logginglevels.DEBUG_2, _('Not Updating Package that is already obsoleted: %s.%s %s:%s-%s'), 
                                             ipkg.pkgtup)


What was happening was we were not checking to see if the pkg that was a potential match was newer than the newest of the items installed. This would only really ever happen on kernels and other weirdo cases like this, afaict.

I could also add a check to the above to see if the pkg we're targetting is not already installed but I wouldn't want to accidentally walk into a reinstall case unknowingly at some future point

Comment 9 seth vidal 2009-01-07 05:41:49 UTC
I tested and committed my patch. It seems to do the right thing. I'll keep it in mind if someone runs into a weird issue in the middle.

Thanks for the good bug report.

Comment 10 Fedora Update System 2009-01-12 19:20:04 UTC
yum-3.2.21-2.fc10 has been submitted as an update for Fedora 10.
http://admin.fedoraproject.org/updates/yum-3.2.21-2.fc10

Comment 11 Fedora Update System 2009-01-12 19:28:22 UTC
yum-3.2.21-2.fc9 has been submitted as an update for Fedora 9.
http://admin.fedoraproject.org/updates/yum-3.2.21-2.fc9

Comment 12 Fedora Update System 2009-02-05 02:18:23 UTC
yum-3.2.21-2.fc10 has been pushed to the Fedora 10 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 13 Fedora Update System 2009-02-05 02:25:59 UTC
yum-3.2.21-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


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