How to Upgrade the Linux Kernel on Debian 11 (Bullseye)
If you’ve been running the stock kernel that shipped with Bullseye for a while, you might have noticed missing driver support or slower performance compared with newer releases. This article shows exactly how to pull a fresh kernel from kernel.org, compile it, and get your system booting the new version without turning your machine into a brick.
Why bother compiling yourself?
I once upgraded a laptop’s Wi‑Fi after a kernel bump only to find the network vanished completely. Rolling back was a pain because the distro’s packages didn’t keep the old build around. Building from source lets you keep the previous kernel intact, pick the drivers you need, and avoid mysterious package conflicts.
Prerequisites
- A Debian 11 installation with sudo rights.
- Build tools: gcc, make, and related headers.
- About 10 GB of free space for the source tree and object files.
Install what you need in one shot:
sudo apt update
sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev
The extra libraries (libncurses-dev, bison, flex) are required for the menu‑driven configuration UI and for building modules that depend on cryptographic APIs.
Grab the source
Head over to kernel.org, find the latest stable release (for example 6.1.x), copy its download link, then pull both the tarball and its signature:
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.12.tar.gz
wget https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.12.tar.sign
Verify it’s legit
Never trust a random tarball on the internet. Import the official signing key and check the signature:
gpg --keyserver hkps://keys.openpgp.org --recv-keys 7638D0442B90D010 gpg --verify linux-6.1.12.tar.sign linux-6.1.12.tar.gz
If you see “Good signature” you’re in the clear; otherwise abort and download again.
Extract and prepare
tar xf linux-6.1.12.tar.gz cd linux-6.1.12
Copy the current kernel’s config as a starting point. This saves you from re‑enabling every driver you already use:
cp -v /boot/config-$(uname -r) .config
Tweak the configuration
Run the classic text UI:
make menuconfig
Navigate with arrow keys; hit Enter to toggle options. A few practical tips:
- Under Processor type and features, set “Processor family” to match your CPU (e.g., Generic x86‑64) – this lets the compiler generate optimal code.
- In Device Drivers → Network device support, enable the specific Wi‑Fi chip you own if it’s not already marked.
- Turn off everything under Kernel hacking unless you’re developing patches; fewer options mean a smaller attack surface.
Save and exit. The .config file now reflects both your existing setup and any new pieces you added.
Build the kernel
First clean out any leftovers from previous attempts:
make clean
Then compile the core image and all modules using every CPU core you have (replace $(nproc) with a fixed number if you want to limit load):
make -j $(nproc) make -j $(nproc) modules
Don’t be surprised if this takes 20–30 minutes on an older laptop – the kernel is huge and the compiler does a lot of work.
Install
sudo make install sudo make modules_install
make install copies the new vmlinuz, the initramfs skeleton, and updates /boot/grub/grub.cfg. modules_install drops all compiled modules into /lib/modules/<version>.
Double‑check the bootloader
Run:
sudo update-grub
Look for a line that mentions the version you just built (e.g., “Linux 6.1.12‑generic”). If it’s missing, edit /etc/default/grub or add a custom entry manually – but in most cases update-grub does the right thing.
Reboot and verify
sudo reboot
After the system comes back up, confirm you’re running the new kernel:
uname -r
You should see something like 6.1.12-.... If anything goes wrong, simply select the old entry from the GRUB menu (it’s still there) and boot back to a known‑good state.
A quick sanity check
Run a couple of commands to make sure modules loaded correctly:
lsmod | grep <your_driver> dmesg | tail -n 20
If your Wi‑Fi or graphics driver shows up, you’re golden. If not, re‑run make menuconfig and enable the missing component.
That’s it – a brand‑new kernel without touching any Debian packages. You now have the performance tweaks, hardware support, and security patches that only upstream releases provide.