Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-09-2004, 12:14 PM   #1
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Rep: Reputation: 15
/usr/src/linux doesn't exist! How do I install it?

Trying to compile GeForce4 drivers on Debian 3 (yes, I gave up on Slackware).

Compiled the driver no problem, but when it came time to compile the kernel, I got an error message to the effect of "your kernel was compiled with something different than you are using now. jerk." and a suggestion that I turn on IGNORE_CC_MISMATCH. I did so, and it worked, except that my kernel source seems not to exist!

There is no /usr/src/linux directory! Clearly I didn't install the kernel source, so how do I do this without reinstalling the whole system? Thanks!
Old 08-09-2004, 12:18 PM   #2
Senior Member
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
ok, /usr/src/linux is a sym-link into the actual kernel source tree

so if you have a source tree ( ls /usr/src ) then just create a sym-link to /usr/src/linux

if you actualy have no kernel source, then apt-get one (i think thats what you debian people use right?)

its important to get the kernel sources that were used to compile the kernel that you use, that way its sure to be most compatible is where the linux kernels are kept if you want a fresh tree
Old 08-09-2004, 12:20 PM   #3
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 15
Just create a sym-link.... is that all? :P I have no idea what that means, man!
Old 08-09-2004, 12:22 PM   #4
LQ Newbie
Registered: Aug 2003
Location: Myanmar
Distribution: Gentoo, Debian
Posts: 7

Rep: Reputation: 0
/usr/src/linux is a symbolic link to your kernel tree.

Grab a kernel (
Extract it to /usr/src.
Create a symbolic link (ln -s /usr/src/linux-x-x-x /usr/src/linux)
(linux-x-x-x is the kernel source that you've extracted)

Now you are ready to tweak your kernel.
Old 08-09-2004, 12:24 PM   #5
Registered: Aug 2004
Location: Chicago
Distribution: Debian testing/unstable
Posts: 82

Original Poster
Rep: Reputation: 15
Aaaaah very clever! I think I understand now. Thanks!
Old 08-09-2004, 03:53 PM   #6
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
You really ought to grab your kernel via apt-get. The kernel source you compile the driver against must be the same as the kernel running on your system, otherwise things can fail in strange ways. Do uname -r to see what kernel you are running, and then do: apt-get install kernel-source-<version>.

This is necessary since many distros, including Debian, do not use stock Linux kernels, but ones that have been specially modified with backports and the like. Therefore a vanilla kernel will probably not match up with the kernel you're running on your system.

Last edited by btmiller; 08-09-2004 at 03:54 PM.


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
/usr/src/linux does not exist Sigkill(9) Linux - Newbie 2 01-02-2005 01:54 PM
/usr/src/linux doesnt exist? santasballz Linux - Newbie 7 02-08-2004 11:32 AM
where is /usr/src/linux matt_w_lambert Mandriva 5 12-26-2003 01:29 AM
Help!!... /usr/src/linux/Makefile does not exist. PhoenixZorn Slackware 4 11-16-2003 09:14 PM
Creating /usr/src/linux-<xx> from kernel.<xx>.src.rpm jmourik Linux - Newbie 2 02-19-2003 04:24 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:36 PM.

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