Koozali.org: home of the SME Server

How to load linux-headers

Offline Chriswilliams

  • *
  • 20
  • +0/-0
How to load linux-headers
« on: June 17, 2008, 09:54:46 PM »
Simple question from a novice:
I am recompiling a kernel module.
During make I get the message "You do not appear to have the sources for the 2.6.9-67.0.7.EL kernel installed"
How do I install the sources with yum. AND do I need all the sources OR do I really just need the headers?

I have tried " yum install linux-headers-`uname -r` "

but it can't find anything to install.

Thanks for your help.

Chris.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to load linux-headers
« Reply #1 on: June 17, 2008, 10:58:13 PM »
Simple question from a novice:
I am recompiling a kernel module.
During make I get the message "You do not appear to have the sources for the 2.6.9-67.0.7.EL kernel installed"
How do I install the sources with yum. AND do I need all the sources OR do I really just need the headers?

I have tried " yum install linux-headers-`uname -r` "

but it can't find anything to install.

Thanks for your help.

Chris.
It is best not to cpmpile on your server, but on a CentOS 4.6 machine (on which SME Server is based) and I would refrain from compiling anything if you are a linux newbie.

If you really would like to have a go, you should not install linux-headers, this is a package that does not exist on RHEL/CentOS based systems, I think you need kernel-devel:
Code: [Select]
yum install kernel-devel
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Chriswilliams

  • *
  • 20
  • +0/-0
Re: How to load linux-headers
« Reply #2 on: June 18, 2008, 08:01:41 PM »
Good advice (not to do it) BUT continuing anyway:

I think I can see my problem:

[root@storm2 ~]# uname -r
2.6.9-67.0.7.EL

[root@storm2 ~]# rpm -q kernel
kernel-2.6.9-67.0.1.EL
kernel-2.6.9-67.0.7.EL
[root@storm2 ~]# rpm -q kernel-devel
kernel-devel-2.6.9-67.0.15.EL
[root@storm2 ~]#

SO: I am running 0.7.EL
       I have installed 0.1.EL and 0.7.EL
BUT my kernel-devel is 0.15.EL

Checking in /lib/modules/2.6.9-67.0.15.EL has a directory build which I think indicates that kernel-devel is there.

Since I can't load kernel-devel-2.6.9-67.0.7.EL, it can't find it,
Should I update the kernel to 0.15.EL (yum install kernel--2.6.9-67.0.15.EL is that correct),
or is there a better answer.

I am learing slowly, thanks for your help.

Chris.


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to load linux-headers
« Reply #3 on: June 18, 2008, 08:12:38 PM »
Good advice (not to do it) BUT continuing anyway:
I think I can see my problem:

[root@storm2 ~]# uname -r
2.6.9-67.0.7.EL

[root@storm2 ~]# rpm -q kernel
kernel-2.6.9-67.0.1.EL
kernel-2.6.9-67.0.7.EL
[root@storm2 ~]# rpm -q kernel-devel
kernel-devel-2.6.9-67.0.15.EL
[root@storm2 ~]#
Since you seem to have messed up your system already by installing all sorts of development libs I really advise you no to go any further...

SO: I am running 0.7.EL
       I have installed 0.1.EL and 0.7.EL
BUT my kernel-devel is 0.15.EL

Checking in /lib/modules/2.6.9-67.0.15.EL has a directory build which I think indicates that kernel-devel is there.

Since I can't load kernel-devel-2.6.9-67.0.7.EL, it can't find it,
Should I update the kernel to 0.15.EL (yum install kernel--2.6.9-67.0.15.EL is that correct),
or is there a better answer.
It seems an update is released somehow for the kernel-devel, but not for the kernel itself... which seems strange to me. However you can easily install kernel-devel for your current version by installing like this (as long as you run the single processor kernel):
Code: [Select]
yum install kernel-devel-`uname -r`If you are running another kernel you should drop the suffix after EL that is reported by the uname -r command. In your case it would read:
Code: [Select]
yum install kernel-devel-2.6.9-67.0.7.EL
When I do so on my test machine it looks like this and does work:
Code: [Select]
yum install kernel-devel-2.6.9-67.0.7.EL
==============================================================
WARNING: Additional commands may be required after running yum
==============================================================
Loading "installonlyn" plugin
Loading "smeserver" plugin
Loading "fastestmirror" plugin
Setting up Install Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Excluding Packages from CentOS - updates
Finished
Excluding Packages from CentOS - os
Finished
Parsing package install arguments
Resolving Dependencies
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for kernel-devel to pack into transaction set.
kernel-devel-2.6.9-67.0.7 100% |=========================| 781 kB    00:01
---> Package kernel-devel.i686 0:2.6.9-67.0.7.EL set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 kernel-devel            i686       2.6.9-67.0.7.EL  updates           3.9 M

Transaction Summary
=============================================================================
Install      1 Package(s)
Update       0 Package(s)
Remove       0 Package(s)
Total download size: 3.9 M
Is this ok [y/N]: n
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Chriswilliams

  • *
  • 20
  • +0/-0
Re: How to load linux-headers
« Reply #4 on: June 18, 2008, 10:05:14 PM »
Thanks for sticking with me on this.

I have run yum:

[root@storm2 ~]# yum install kernel-devel-2.6.9-67.0.7.EL
==============================================================
WARNING: Additional commands may be required after running yum
==============================================================
Loading "fastestmirror" plugin
Loading "smeserver" plugin
Setting up Install Process
Setting up repositories
Loading mirror speeds from cached hostfile
Reading repository metadata in from local files
Excluding Packages from CentOS - updates
Finished
Excluding Packages from CentOS - os
Finished
Parsing package install arguments
Nothing to do
================================================================
No new rpms were installed. No additional commands are required.
================================================================


Its as though it thinks its already installed. But yum remove kernel-devel-2.6.9-67.0.7.EL says that no packages match that name.

I must have done something wrong at some stage, but how to recover?

Thanks,

Chris.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to load linux-headers
« Reply #5 on: June 18, 2008, 10:09:51 PM »
I must have done something wrong at some stage, but how to recover?
Perhaps you should remove the newer ones, with a version number higher than your current kernel.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline Chriswilliams

  • *
  • 20
  • +0/-0
Re: How to load linux-headers
« Reply #6 on: June 19, 2008, 10:16:04 AM »
THAT was the correct answer!

I did yum remove kernel-devel

and it removed 67.0.15.EL

I then tried yum install kernel-devel and it TRIED to reinstall 67.0.15.EL so I aborted.

I then tried yum install kernel-devel-2.6.9-67.0.7.EL

AND IT WORKED.

I have now been able to compile my little module.

Thanks for all your help.

Chris.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: How to load linux-headers
« Reply #7 on: June 19, 2008, 11:12:28 AM »
Thanks for all your help.

Chris.
You're welcome, although I suggest you install a sepcial (virtual) machine for it if you need to do this more often, with the CentOS version installed on which SME Server is based.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)