Is there a resource to download a specific kernel version source? For example, I want to get sources to compare with this package and see what changes were introduced?

  • 1
    The link in this question seems to be broken. Mar 21, 2015 at 10:55

4 Answers 4


The easiest and most bandwidth-friendly way, if you expect to do this more than once, would be to clone the kernel's git repository and check out the version you want based on its tag. It's probably best to clone the linux-stable repo, since that will include tags for all of the stable releases:

git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
cd linux-stable
git checkout v2.6.36.2

To later switch to another version, it's easy:

git checkout v3.5.2

To update your repository to include all of the latest tags and commits:

git fetch

Yes, kernel.org has all released versions, including Note, however, that most Linux distributions apply own patches to the vanilla kernel source.


If you do not want to download whole kernel commit history (which is well above 1 GiB), you can download only such part of the kernel Git repo that leads to your desired branch. E.g. to locally checkout the Ubuntu kernel in version 4.5, you'd do:

git clone --depth 1 --single-branch --branch v4.5  git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack

This way, the clone is about 150 MiB.


If you just want to get one tag for quick compilation, do:

git clone --depth 1 --branch v4.18 \

--depth 1 does a shallow clone, which drastically reduces the clone time and disk usage.

It only works for tags currently unfortunately, not arbitrary commits, due to how the cgit git server works and is configured. See also: https://stackoverflow.com/questions/3489173/how-to-clone-git-repository-with-specific-revision-changeset

See also: Why is the git clone of the Linux kernel source code much larger than the extracted tar.xz?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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