Cannot find kernel sources

Hi guys

I just made new install of 64bit openSuse 11.3. I need to get kernel sources, but I cannot find them via yast2 sw management.

The ‘uname -r’ command tells me, that my kernel is 2.6.34-12-desktop. The only version i can manage to install via yast is 2.6.34.7-0.7.1 (which, when used, results in error). I have looked at the list of repositories here and it seems i have added all relevant of them.

any hints?
thanks in advance

What is the output of


zypper lr -d

?

# | Alias                               | Name                                | Enabled | Refresh | Priority | Type   | URI                                                             | Service
--+-------------------------------------+-------------------------------------+---------+---------+----------+--------+-----------------------------------------------------------------+--------
1 | Updates for openSUSE 11.3 11.3-1.82 | Updates for openSUSE 11.3 11.3-1.82 | Yes     | Yes     |   99     | rpm-md | http://download.opensuse.org/update/11.3/                       |
2 | openSUSE-11.3 11.3-1.82             | openSUSE-11.3 11.3-1.82             | Yes     | No      |   99     | yast2  | cd:///?devices=/dev/sr0                                         |
3 | repo-debug                          | openSUSE-11.3-Debug                 | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/debug/distribution/11.3/repo/oss/  |
4 | repo-non-oss                        | openSUSE-11.3-Non-Oss               | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/11.3/repo/non-oss/    |
5 | repo-oss                            | openSUSE-11.3-Oss                   | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/distribution/11.3/repo/oss/        |
6 | repo-source                         | openSUSE-11.3-Source                | Yes     | Yes     |   99     | yast2  | http://download.opensuse.org/source/distribution/11.3/repo/oss/ |

Have you done updates yet (YaST -> Online Update)? Your kernel should be 2.6.34.7-0.7-desktop which is available in updates

Once you have done that you can install kernel sources like this in the terminal as root (by first doing su -):


zypper in -t pattern devel_kernel

That should do it.

I updated just before this reply. the ‘uname -r’ now tells 2.6.34.7-0-7-desktop, so i guess the update went OK.

Now I see that the source and kernel version are the same… but I am bit puzzled. I am trying to do some installation, which in process wants to know where ‘linux/version.h’ file is located.

# find / -name version.h
/usr/include/linux/dvb/version.h
/usr/include/linux/version.h
/usr/src/linux-2.6.34.7-0.7/drivers/net/cxgb3/version.h
/usr/src/linux-2.6.34.7-0.7/fs/btrfs/version.h
/usr/src/linux-2.6.34.7-0.7/include/sound/version.h
/usr/src/linux-2.6.34.7-0.7/include/xen/interface/version.h
/usr/src/linux-2.6.34.7-0.7/include/linux/dvb/version.h
/usr/src/linux-2.6.34.7-0.7/arch/x86/math-emu/version.h
/usr/src/linux-2.6.34.7-0.7-obj/x86_64/default/include/linux/version.h
/usr/src/linux-2.6.34.7-0.7-obj/x86_64/desktop/include/linux/version.h
/usr/src/linux-2.6.34.7-0.7-obj/x86_64/xen/include/config/xen/interface/version.h
/usr/src/linux-2.6.34.7-0.7-obj/x86_64/xen/include/linux/version.h

I have tried to supply directories listed on fourth and third line from the bottom, but it results in error saying, that version of header files does not match version of running kernel… I have looked again in sw management via yast2, if I did not overlook some kernel source packages and found nothing.

oh, i missed your reply with zypper. going to try it right away.

OK good luck let us know if it works or not

sooo… over 200 packages installed… and situation is still the same.

What application are you trying to install which requires the kernel sources?

VMWare Server 2.0.2. Some months ago i managed to install it on openSuse 11.2 with help of Radu Cotescu’s script (post on his blog). I checked his blog again, saw he updated his script, so I gave it a try.

As I was writing this reply, I checked the blog again… Maybe I was not paying much attention. It states that script works for version 2.6.32 AND 2.6.35 kernels… but it does not have to mean, that it works for versions from 2.6.32 TO 2.6.35. one big facepalm

Maybe its time to stick back to openSuse 11.2… sigh.

Have a look at this wiki article:
SDB:Installing VMware server or workstation - openSUSE

Specifically under “Patching VMware”. That might help

phaluz wrote:
> I updated just before this reply. the ‘uname -r’ now tells
> 2.6.34.7-0-7-desktop, so i guess the update went OK.
>
> Now I see that the source and kernel version are the same… but I am
> bit puzzled. I am trying to do some installation, which in process wants
> to know where ‘linux/version.h’ file is located.
>
>
> Code:
> --------------------
> # find / -name version.h
> /usr/include/linux/dvb/version.h
> /usr/include/linux/version.h
> /usr/src/linux-2.6.34.7-0.7/drivers/net/cxgb3/version.h
> /usr/src/linux-2.6.34.7-0.7/fs/btrfs/version.h
> /usr/src/linux-2.6.34.7-0.7/include/sound/version.h
> /usr/src/linux-2.6.34.7-0.7/include/xen/interface/version.h
> /usr/src/linux-2.6.34.7-0.7/include/linux/dvb/version.h
> /usr/src/linux-2.6.34.7-0.7/arch/x86/math-emu/version.h
> /usr/src/linux-2.6.34.7-0.7-obj/x86_64/default/include/linux/version.h
> /usr/src/linux-2.6.34.7-0.7-obj/x86_64/desktop/include/linux/version.h
> /usr/src/linux-2.6.34.7-0.7-obj/x86_64/xen/include/config/xen/interface/version.h
> /usr/src/linux-2.6.34.7-0.7-obj/x86_64/xen/include/linux/version.h
>
> --------------------
>
>
> I have tried to supply directories listed on fourth and third line from
> the bottom,

Did you try the most obvious directory, which is
/usr/include/linux/version.h ?

If so, what was the result?

Perhaps you need to install the kernel development files? So, to compile a kernel for instance, I normally open up YaST / Software / Software Management and select the view button on the top left and select Patterns. Then, on the left column, I select Base Development, C++ Development and Kernel Development and allow these Packages to be installed and then see if you can do what you want.

Thank You,

djh-novell: not relevant now, as ah7013’s article was helpful.

it is alive and kicking!

thank you both for your time.
thanks to ah7013 for great advice. and i guess next time i will spend more time searching… shame on me.

No problem :slight_smile: