LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 03-17-2004, 11:52 PM   #1
kix_vn
LQ Newbie
 
Registered: Jan 2004
Posts: 13

Rep: Reputation: 0
how to properly install kernel source in Debian ?


I used "apt-get install kernel-source-2.5.25", and everything seems fine,
but when I ran some program that needs kernel source, it couldn't detect the path to kernel source directory (I did the same thing in Lindows which is based on Debian and that program could automatically detect the kernel source),
I also manually enter the path to the kernel source directory, that I think is "/usr/src", but then it gave so many errors when compiling

one more thing is that first, it said something wrong about "cc - command not find", and I use "apt-get install gcc", then it passed that point, but got stuck like what I described

so, anyone can suggest some hints for me ?

thanks

in case u need more information, the program i tried to install is here
http://www.nus.edu.sg/vpn/download/n....3.B-k9.tar.gz
 
Old 03-18-2004, 12:13 AM   #2
misterflibble
Member
 
Registered: Feb 2004
Distribution: Debian UnStaBle
Posts: 123

Rep: Reputation: 15
OK, I'm assuming you meant kernel 2.4.25, as 2.5 is an unstable kernel devolpment branch and I don't think its in debian. When you install the kernel source in debian, all apt-get does is download the gziped source to /usr/src. You need to uncompress it there and you'll end up with a directory like /usr/src/kernel-source-2.4.25/ with all the kernel source. You then need to create a symbolic link to that directory named /usr/src/linux, ie "ln -s /usr/src/kernel-source-2.4.25 /usr/src/linux" for the program to know which kernel source to use (its possible to have more than one).
 
Old 03-18-2004, 03:46 AM   #3
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 63
You want the kernel-headers-2.4.25-??? not the source anyways, the source package is just a Debianized version of the official kernel sources not a fully configured source tree. Then if a program complains about missing source make sure that you have ln -s /usr/src/kernel-headers-2.4.25-??? /usr/src/linux to have the proper symbolic link. Replace the ??? with the kernel flavor you are running eg. 386,k7, 686 ....
 
Old 03-18-2004, 05:45 AM   #4
kix_vn
LQ Newbie
 
Registered: Jan 2004
Posts: 13

Original Poster
Rep: Reputation: 0
but how can I find "kernel-headers-..." , it can't be installed via apt-get ("apt-get install kernel-header"), all i can find there is kernel image and kernel source
thanks
 
Old 03-18-2004, 11:39 AM   #5
Outabux
Member
 
Registered: Apr 2003
Location: Greenwood Mississippi
Distribution: Debian, LMDE, n some untus
Posts: 215

Rep: Reputation: 30
try apt-cache search kernel-headers with the caveat your /etc/sources.list is appropriate...

If that doesn't get it, google around, or go to debians site and look through either unstable or stable (?) for the answers. Use the site map.
U may be able to then download those headers kix_vn has suggested and unzip them with either gunzip (gz extension) or bunzip2 (bz2 extension).

A good thing to do would be to apt-get kernel-package, as it includes the bunzip2 and other tools u may need when compiling.

Personally I'm using the unstable branch of packages

Now my personal experience in trying to create a debian OS to suit my needs was to start fresh with bf2.4 and migrate immediately to 2.6.X and add packages later.

that was done by editing my sources.list file and
apt-get clean
apt-get update
apt-get upgrade
apt-get dist-upgrade

though the apt-get dist-upgrade may eat up the apt-get upgrade (dunno)
heres my sources list for unstable, i believe if u are using stable or testing...alls u gotta do is replace unstable with either testing or stable.

#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-7 (20021218)]/ unstable contrib main non-US/contrib non-US/main
#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-6 (20021218)]/ unstable contrib main non-US/contrib non-US/main
#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-5 (20021218)]/ unstable contrib main non-US/contrib non-US/main
#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-4 (20021218)]/ unstable contrib main non-US/contrib non-US/main
#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-3 (20021218)]/ unstable contrib main non-US/contrib non-US/main
#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-2 (20021218)]/ unstable contrib main non-US/contrib non-US/main
#deb cdrom:[Debian GNU/Linux 3.0 r1 _Woody_ - Official i386 Binary-1 (20021218)]/ unstable contrib main non-US/contrib non-US/main


deb ftp://ftp.us.debian.org/debian/ unstable main non-free contrib
deb-src ftp://ftp.us.debian.org/debian/ unstable main non-free contrib
deb http://non-us.debian.org/debian-non-US unstable/non-US main contrib non-free
deb-src http://non-us.debian.org/debian-non-US unstable/non-US main contrib non-free
deb http://security.debian.org/ stable/updates main contrib non-free

i hope this helps but dunno, keep on keepin on. U'll get it.

Oh yeah dont worry about the cdrom entries, they must be done differently, just try the last uncommented statements.

Kool!

Last edited by Outabux; 03-18-2004 at 11:41 AM.
 
Old 03-18-2004, 06:09 PM   #6
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 63
Quote:
Originally posted by kix_vn
but how can I find "kernel-headers-..." , it can't be installed via apt-get ("apt-get install kernel-header"), all i can find there is kernel image and kernel source
thanks
Code:
HappyTux:/home/stephen# apt-cache search kernel-headers-2.4.25-*
kernel-headers-2.4.25-1 - Header files related to Linux kernel version 2.4.25
kernel-headers-2.4.25-1-386 - Linux kernel headers 2.4.25 on 386
kernel-headers-2.4.25-1-586tsc - Linux kernel headers 2.4.25 on Pentium-Classic
kernel-headers-2.4.25-1-686 - Linux kernel headers 2.4.25 on PPro/Celeron/PII/PIII/PIV
kernel-headers-2.4.25-1-686-smp - Linux kernel headers 2.4.25 on PPro/Celeron/PII/PIII/PIV SMP
kernel-headers-2.4.25-1-k6 - Linux kernel headers 2.4.25 on AMD K6/K6-II/K6-III
kernel-headers-2.4.25-1-k7 - Linux kernel headers 2.4.25 on AMD K7
kernel-headers-2.4.25-1-k7-smp - Linux kernel headers 2.4.25 on AMD K7 SMP
kernel-headers-2.4.25 - Header files related to Linux kernel version 2.4.25
 
Old 03-18-2004, 06:57 PM   #7
kix_vn
LQ Newbie
 
Registered: Jan 2004
Posts: 13

Original Poster
Rep: Reputation: 0
yeah, thanks u guys, finally it worked, all I need is to install kernel header in addition to kernel source,
my mistake was that i used "apt-get install kernel-header" instead of "apt-get install kernel-headers"
 
Old 03-20-2004, 08:17 AM   #8
markopolox
LQ Newbie
 
Registered: Sep 2003
Posts: 12

Rep: Reputation: 0
Link

I never understand this, maybe someone can help

Quote:
You then need to create a symbolic link to that directory named /usr/src/linux, ie "ln -s /usr/src/kernel-source-2.4.25 /usr/src/linux" for the program to know which kernel source to use (its possible to have more than one).
Do you really need a symbolic link or can you install the kernel without it?
 
Old 03-20-2004, 01:30 PM   #9
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 3,513

Rep: Reputation: 63
Re: Link

Quote:
Originally posted by markopolox
I never understand this, maybe someone can help



Do you really need a symbolic link or can you install the kernel without it?
It is not absolutely needed the kernel will install fine without it now when compiling additional software it all depends on whether that software wants that link to exist or you can pass some parameter to tell it where the kernel-headers or source are located if installed, sometimes you have no choice and you need the fully configured source tree with the link pointing to /usr/src/linux.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian woody-wheres my kernel source ? da_zombie Linux - Software 1 10-17-2004 09:22 AM
how to link to kernel source for Debian ndiswrapper installation case1984 Linux - Newbie 0 09-10-2004 10:32 AM
installig kernel source with debian Bullzeye Linux - Newbie 8 08-28-2003 11:39 PM
Debian kernel source tenn_eric Linux - Hardware 2 05-29-2003 10:25 PM
Debian kernel source Jack Lord Linux - Distributions 4 11-10-2002 05:22 AM


All times are GMT -5. The time now is 07:16 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration