officialrepo

torvalds/linux

★ 257k starsCPublic
View on GitHub ↗

A community setup & usage guide for the Linux kernel GitHub repository. Official repo: torvalds/linux

Linux kernel source tree.

What is Linux kernel?

torvalds/linux is the official mainline source tree of the Linux kernel. Most people never build it — your distribution ships a kernel — but kernel developers clone, configure and compile it. These steps are for that audience.

Installation

  1. Clone the tree (shallow for speed)
    git clone --depth=1 https://github.com/torvalds/linux.git && cd linux
  2. Install build deps (Debian/Ubuntu)
    sudo apt install build-essential bc bison flex libssl-dev libelf-dev
  3. Configure and build
    make defconfig && make -j$(nproc)
Verify
make kernelversion

Usage

Base config on your running kernel
make olddefconfig
Build just the kernel image
make -j$(nproc) bzImage

Before you start

A Linux build environment with GCC/Clang and the usual kernel build dependencies. Building takes significant time and disk space.

Official repository: github.com/torvalds/linux

FAQ

Do I need to build the kernel?

Almost never — use your distro's packaged kernel unless you're developing or testing kernel changes.

How do I contribute?

Kernel development uses an email/patch workflow — see Documentation/process in the tree.

Where is the official Linux kernel GitHub repository?

The official Linux kernel GitHub repo is hosted at github.com/torvalds/linux. This page links straight to it and summarises how to install and use Linux kernel.

Is this the official Linux kernel repo?

No. officialrepo.com is an independent community guide. The official Linux kernel GitHub repository is github.com/torvalds/linux — always treat that repo and its documentation as the source of truth.

This is an independent community guide. Linux kernel and its logo are trademarks of their respective owner; officialrepo.com is not affiliated with or endorsed by the project or GitHub, Inc. The link above points to the genuine official repository.