LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 08-09-2011, 09:35 AM   #1
dspjm
Member
 
Registered: Dec 2010
Distribution: Scientific Linux Slackware
Posts: 91

Rep: Reputation: 2
How to install linux kernel


When I install some linux distributions, such as fedora, debian, especially live version, there is no source code of linux kernel under /usr/src, how can i install the source code?
Thanks
 
Old 08-09-2011, 10:23 AM   #2
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

You need to pick it up at the website , put it somewhere in the user folder and unpack it.

Next, you may want to compile it...
Greetz!

Thor
 
Old 08-09-2011, 11:01 AM   #3
dspjm
Member
 
Registered: Dec 2010
Distribution: Scientific Linux Slackware
Posts: 91

Original Poster
Rep: Reputation: 2
I mean the src of kernel under /usr/src is the source code of the current kernel. If I download a new one and compile it, the system might not work. When I install VMPlayer or something, I have to use /usr/src/kernels to install the software. So ...
 
Old 08-09-2011, 11:35 AM   #4
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Nonononono, this is not really how a kernel works.
Granted, the ./usr/src should hold the source code of the current kernel. Your distro should have that in the repo. You could download that.

But, if you want to compile a kernel, there needs to be a good reason for it. Kernels are fairly well fine-tuned to most needs, so a recompile needs to be founded in some extra need.

Is there a reason to recompile, then go tahe these steps (roughly)

Find out what kernel you use now:

Quote:
uname -r
...will return the version number. Go to the site and download that package. Put it in your folder after unpacking.

Enter

Quote:
make menuconfig
to do the tweaks, then

Quote:
make
to compile and finally

Quote:
make install
Tweak the GRUB as required.

If you'd use a newer version, be aware that the ODD numbers are experimental, the EVEN numbers are stable. The choice (of course) is yours...

At any rate, whatever is installed on the system will/should run.

See a kernel as an engine in a Lambo. By recompiling it, you basically get to choose the engine before you drive out of the garage.

In the GRUB menu, you get to choose the kernel, the old (and fully working one) stays around, if all goes bad, restart the system, and choose the previous kernel and you're off...

Thor
 
Old 08-09-2011, 08:06 PM   #5
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,691
Blog Entries: 4

Rep: Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947Reputation: 3947
The source-code of a kernel is not required in order to successfully install a new kernel, i.e. from a package.

That source-code may be required, however, if the program in question needs to know about kernel-related data structures that pertain to the currently-installed kernel.

This is why "kernel source-code" is usually designated as an optional package.
 
  


Reply



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
How to install linux on a no-default-install-kernel-compatible controller ? DukeMC Linux - Hardware 2 11-20-2003 03:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

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

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
Open Source Consulting | Domain Registration