LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   how to properly install kernel source in Debian ? (https://www.linuxquestions.org/questions/debian-26/how-to-properly-install-kernel-source-in-debian-159252/)

kix_vn 03-17-2004 11:52 PM

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

misterflibble 03-18-2004 12:13 AM

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).

HappyTux 03-18-2004 03:46 AM

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 ....

kix_vn 03-18-2004 05:45 AM

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

Outabux 03-18-2004 11:39 AM

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!:newbie: :cool:

HappyTux 03-18-2004 06:09 PM

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


kix_vn 03-18-2004 06:57 PM

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"
:)

markopolox 03-20-2004 08:17 AM

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?

HappyTux 03-20-2004 01:30 PM

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.


All times are GMT -5. The time now is 06:12 PM.