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.

2 Answers 2


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

  • I think 2.6.26 was a typo in the title; he used 2.6.36 in the body Jun 10, 2011 at 20:09
  • @Michael, yeah, I just noticed that. Thanks.
    – cjm
    Jun 10, 2011 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.

  • He doesn't have permissions to install stuff using Portage, and I think that will prevent downloading, too.
    – cjm
    Jun 11, 2011 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, 2011 at 5:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .