How to download correct kernel source?

The thread title says it. I installed 11.0 on a machine a few days ago, and the kernel version is 2.6.26.16-0.1. I download the source (with Yast2), and after spending several hours configuring, compiling & making several attempts at installing NVIdia’s CUDA system, I notice that the source Yast2 dowloaded for me is 2.6-26.5-1. I need source matching the current kernel, or the latest version: how do I get it? And if possible as a delta, so I don’t have to download the whole 250 Mbytes or so.

Now the really odd thing is that I installed 11.0 on another machine a few weeks before, using the same boot CD, downloaded the source, and got 2.6.25.11-0.1.

I’ve tried adding repositories, and suggested on the OpenSuSE download page, but still get the same version.

…and the kernel version is 2.6.26.16-0.1

Hmm… are you sure about the version number there. I’m using openSuSE 11.0 with the latest kernel from openSUSE-11.0-Updates repository and my kernel version is 2.6.25.16-0.1 (notice the difference? 25 in my case, 26 in your case).

Anyway, make sure you have a proper update repository configured. You can check by listing them to a file with:

zypper lr -e repos

and then read the generated file repos.repo. For instance, my update repository is

http://download.opensuse.org/update/11.0/

Also make sure it is enabled.

If all that is OK you should be able to install a desired kernel-source version, for instance version 2.6.25.16-0.1 with:

zypper in kernel-source=2.6.25.16-0.1

if it is available among your repositories that is. And this version should be in the repository mentioned above.

YaST can of course do the same job for you, assuming repositories are correctly setup, but I prefer the zypper command line tool as I feel it becomes more apparent what is happening.

You’re right: the 26 was my typo. Shouldn’t do these things late at night…

Anyway, I think I found the problem, or at least how I managed to get around it. If I use the graphical Yast2, I get the older .5 version of the source. If instead I use the text-mode Yast (as I think I did on the older system), I get the up-to-date .16 source. I don’t do anything to change repository sources, just ran the different programs, so it seems Yast2 must have some difference in how they are handled.

Make sure the update repositories are set up to automatically refresh. Not hard to inadvertently disable that.