Bug 1047041

Summary: problem resolving 'kernel-devel-uname-r' as a dependency
Product: [Fedora] Fedora Reporter: Branko Grubić <bitlord0xff>
Component: yumAssignee: Packaging Maintenance Team <packaging-team-maint>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: admiller, fedora, ffesti, firas.alkafri, hobbes1069, james.antill, jzeleny, kwizart, packaging-team-maint, sergio, zpavlas
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-01-07 14:43:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
yum install akmod-nvidia -v none

Description Branko Grubić 2013-12-28 17:10:55 UTC
Created attachment 842694 [details]
yum install akmod-nvidia -v

Description of problem:
When using rpmfusion repo, and installink 'akmod-nvidia' package, 'akmods' package requires 'kernel-devel-uname-r', and instead of kernel-devel-$(uname -r) it gets 'kernel-debug-devel-3.12.5-302.fc20.x86_64' (kernel-debug-devel-$(uname -r)) << This is just an example, I'll include part of the log from 'yum install akmood-nvidia -v' 


Version-Release number of selected component (if applicable):
yum-3.4.3-128.fc20.noarch

How reproducible:


Steps to Reproduce:
1. 
2.
3.

Actual results:
Instead of 'kernel-devel-$(uname -r)' yum installs 'kernel-debug-devel-$(uname -r)'

Expected results:
yum installs required package

Additional info:

Comment 1 Jan Zeleny 2014-01-02 08:32:24 UTC
This is not a bug in yum, it just does what it's told to do by package requirement lists. In this case the culprit is clearly the akmods package, see repoquery --requires akmods. Also, judging from the fact that there are actually some packages providing the dependency, the behavior might be intentional - maintainer of the akmods package might know some details.


In any case, I'm closing the bug.

Comment 2 Nicolas Chauvet (kwizart) 2014-01-04 13:25:27 UTC
Hi Jan,
Thx for responding.

Akmods current maintainer speaking.
I confirm the behavior has changed between f19 and f20, and I feel the problem is in the yum virtual dependency resolution step. (Nothing has changed from the akmods POV).

akmods has "Requires: kernel-devel-uname-r". The intend is (despite the name) not to hardcode the require to one or another kernel-devel "varriant" (PAE/smp/lpae/whatever) and not the kernel-devel matching the running kernel. (despite that would be the final goal).

It's still imperfect and can be improved but at least worked fine on default kernel.x86_64 because the kernel-devel "shortest name" should win over other more unusual variant.
That's the only reason why I expect to have more weight against kernel-devel, because the later doesn't has a dependency on the (installed) kernel itslef given that it's possible to cross-compile for another kernel variant.


Given the current problem description, I expect the above change to have implication with others packages using virtual dependencies.

Comment 3 Jan Zeleny 2014-01-06 07:38:34 UTC
Nicolas, thank you for more details on this. I must say I'm a bit confused what exactly is the problem but then again I'm not a yum developer. Setting needinfo to James, perhaps he'll know what's going on.

Comment 4 James Antill 2014-01-07 14:43:24 UTC
> It's still imperfect and can be improved but at least worked fine on default kernel.x86_64 because the kernel-devel "shortest name" should win over other more unusual variant.

Shortest name is far from the only thing we look at when comparing providers, see:

http://yum.baseurl.org/wiki/CompareProviders

...specifically I assume you are hitting #10 where yum will compare the provide versions of "3.12.5-302.fc20.x86_64" and "3.12.5-302.fc20.x86_64+debug", and so decide the later is newer and prefer to install that.

Comment 5 Thorsten Leemhuis 2014-01-07 21:15:43 UTC
That "Requires: kernel-devel-uname-r" in kernel.spec was a stupid hack anyway, just to make sure we get the default kernel-devel if none is installed. Sigh, I wish the default kernel had some tag as well, that would make a lot of things easier. 

@bitlord, @kwizart: you might want to change the requires in akmod.spec to "Requires: kernel-devel(%{__isa})" (untested, but should do what yum did previously afaics)

Comment 6 Richard Shaw 2015-04-11 16:55:37 UTC
I don't think this bug should be closed, I noticed on a fresh install of F21 when I installed the "Development Tools" group that kernel-debug-devel was installed instead of kernel-devel which I'm guessing is not the intended default behavior. 

# dnf --installroot ~/tmp --releasever 21 group install "Development Tools" --setopt=tsflags=nocontexts --nogpgcheck
Using metadata from Sat Apr 11 11:49:46 2015
Dependencies resolved.
================================================================================
 Group                     Packages                                            
================================================================================
Marking installed:
 Development Tools         gitg             dejagnu                 quilt      
                           diffstat         bzr-explorer            cvs2cl     
                           svn2cl           utrac                   nemiver    
                           expect           translate-toolkit       buildbot   
                           qgit             gtranslator             git        
                           scanmem          tig                     gettext    
                           rcs              subversion              robodoc    
                           patchutils       manedit                 rapidsvn   
                           subunit          cvsgraph                systemtap  
                           monotone         archmage                tailor     
                           cvsps            tkcvs                   tortoisehg 
                           giggle           darcs                   doxygen    
                           bzr              git-cola                gambas3-ide
                           mercurial        cvs                     git-annex  
                           meld             mr                      highlight  
                           lcov             colordiff               git2cl     
================================================================================
 Package                  Arch     Version                      Repository
                                                                           Size
================================================================================
Installing:
[SNIP]
 kernel-debug-devel       x86_64   3.19.3-200.fc21              updates   9.4 M
 kernel-headers           x86_64   3.19.3-200.fc21              updates   974 k
[SNIP]

Comment 7 Richard Shaw 2015-04-11 17:17:09 UTC
(In reply to Thorsten Leemhuis from comment #5)
> That "Requires: kernel-devel-uname-r" in kernel.spec was a stupid hack
> anyway, just to make sure we get the default kernel-devel if none is
> installed. Sigh, I wish the default kernel had some tag as well, that would
> make a lot of things easier. 
> 
> @bitlord, @kwizart: you might want to change the requires in akmod.spec to
> "Requires: kernel-devel(%{__isa})" (untested, but should do what yum did
> previously afaics)

That pretty much got it. Turns out %{_isa} (one underscore) adds the () for you. Just tested installing in mock for both i686 and x86_64.

Comment 8 Sergio Basto 2016-04-04 00:23:15 UTC

*** This bug has been marked as a duplicate of bug 1228897 ***