Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I get (i.e. what command to use) sources for kernel-2.6.36-r4 (uname -a says that it is version 2.6.36-gentoo-r4), or where from I can download it?

I want to compile the userside 'perf' tools, and I'd rather they match kernel version.

share|improve this question
up vote 2 down vote accepted

Well, if you look in /var/db/pkg/sys-kernel/gentoo-sources-2.6.36-r4/SRC_URI, you'll see what it downloaded. First, I'd look in /usr/portage/distfiles/ and see if the files are still there. (Actually, first you should look at /usr/src/linux and see if the kernel sources are still installed. You could just copy them to a directory you can write to.)

I don't have that kernel installed, but it'll probably look something like this (this is from 2.6.36-gentoo-r5):

            deblob? (
                http://www.fsfla.org/svnwiki/selibre/linux-libre//download/releases/LATEST-2.6.36.N/deblob-check -> deblob-check-2.6.36
mirror://gentoo/genpatches-2.6.36-7.base.tar.bz2 mirror://gentoo/genpatches-2.6.36-7.extras.tar.bz2 

You can probably ignore the deblob part, as that's for GPL fanatics. The main things you need are the base kernel and the genpatches.

A mirror:// URL means that you can fetch it from one of the sites listed in /usr/portage/profiles/thirdpartymirrors.

So, you could replace mirror://kernel with http://www.kernel.org/pub and mirror://gentoo with http://mirrors.kernel.org/gentoo/distfiles to get URLs that you can download (or you could pick different mirrors).

share|improve this answer
I think 2.6.26 was a typo in the title; he used 2.6.36 in the body – Michael Mrozek Jun 10 '11 at 20:09
@Michael, yeah, I just noticed that. Thanks. – cjm Jun 10 '11 at 20:13

That particular kernel seems to have been removed from portage. But generally you can use the -f flag to emerge to just fetch a file.

This command:

emerge -f =sys-kernel/gentoo-sources-2.6.36-r8

Gets the next closest one. You might want to go ahead and install that. Or a newer one if you can.

share|improve this answer
He doesn't have permissions to install stuff using Portage, and I think that will prevent downloading, too. – cjm Jun 11 '11 at 3:55
Well shoot then, just go to ftp.kernel.org. Download into home directory. Gentoo emerge will actually download the "pristine" sources plus patches, anyway. You at least have to go through the install phase to get the gentoo patches applied automatically. – Keith Jun 11 '11 at 5:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.