LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-07-2012, 04:49 PM   #1
g_p_linux
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Rep: Reputation: Disabled
Where are the headers and source files of my current Linux distribution?


Hello,

i'm trying to find the headers and source files of the current Linux distribution in order to
to configure a file system by using the current kernel sources but i can't.

Code:
[~]$ uname -a
Linux 2.6.35.7-23Mar x86_64 x86_64 x86_64 GNU/Linux
[~]locate 2.6.35.7-23Mar
/boot/System.map-2.6.35.7-23Mar
/boot/initrd- 2.6.35.7-23Mar.img
/boot/vmlinuz-2.6.35.7-23Mar
/lib/modules/2.6.35.7-23Mar
/lib/modules/2.6.35.7-23Mar/build ... etc
Also under /usr/src/ folder there is a folder named "linux-2.6.35.7",
but the headers are not in there

Where can i find the current kernel sources and headers?
Shall i install them?

Thanks, in advance
 
Old 02-07-2012, 05:13 PM   #2
rabbit2345
Member
 
Registered: Apr 2007
Location: 中国上海
Distribution: openSUSE 11.3
Posts: 371

Rep: Reputation: 40
Hi,

Most distributions do not have kernel sources and headers installed by default, so you will need to install them. Usually, they are in a package called kernel-source/kernel-headers or some variation of that depending on your distribution. For example, the package is called "linux-source" in Ubuntu, but in SUSE it is called kernel-source. First tell us your distribution, although google'ing it would likely be faster.

good luck,
rabbit2345
 
Old 02-07-2012, 05:16 PM   #3
g_p_linux
LQ Newbie
 
Registered: Oct 2011
Posts: 12

Original Poster
Rep: Reputation: Disabled
thanks for replying

Linux version 2.6.35.7-23Mar gcc version 4.1.2 20080704 (Red Hat 4.1.2-48))

does this help?
 
Old 02-07-2012, 05:25 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
The headers are in /usr/src/linux-2.6.35.7/include/<folders>/
( Unless those are empty folders.)
Also : The link /lib/modules/2.6.35.7-23Mar/build
is supposed to point to /usr/src/linux-2.6.35.7/ .


About the header utsrelease.h, that you are asking for here
http://comments.gmane.org/gmane.comp...fs2.users/2637
Can have a location like ...
/usr/src/linux-2.6.35.7/include/generated/utsrelease.h

.

Last edited by knudfl; 02-07-2012 at 05:27 PM.
 
1 members found this post helpful.
Old 02-07-2012, 05:26 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
You probably just need to
Code:
yum install kernel-headers kernel-devel
And any others you need.

Code:
yum list | grep kernel
will give you everything that's available from your repo.
 
1 members found this post helpful.
Old 02-07-2012, 05:36 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
Quote:
(Red Hat 4.1.2-48)
That's Redhat EL 5.x ( The command 'cat /etc/redhat-release' will tell.)

And : 'yum install kernel-devel' will install headers from 2.6.18-274.*
 
1 members found this post helpful.
  


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
Makefiles, building source from another folder with obj files > subfolder of current? Funkster Programming 1 11-11-2011 07:29 AM
[SOLVED] Multiple source files and headers in a Code::Blocks project. How? searching_for_answers Programming 2 09-11-2011 01:53 PM
Zypper wants to dl the wrong kernel headers... YaST doesnt have current headers zorb SUSE / openSUSE 2 11-28-2009 12:12 PM
What's the main reason for using your current Linux distribution? ak_random Linux - Distributions 19 03-18-2008 06:45 AM


All times are GMT -5. The time now is 10:39 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration