Parrot Linux ships a ready-made kernel that suits almost everyone. Building your own makes sense when you need a driver or option the stock kernel does not have, want to test a patch, or want to learn how the kernel is put together. This guide builds a kernel the Debian way, as installable .deb packages, so you can remove it again with APT.
Before you start
- A custom kernel no longer gets security updates from the Parrot repositories. You have to rebuild it yourself.
- It is not signed, so it will not boot with Secure Boot enabled.
- Keep the stock kernel installed. If the new one fails to boot, pick the old one under Advanced options in the GRUB menu.
- Plan for 20–30 GB of free disk space and anything from twenty minutes to a few hours of build time, depending on the CPU.
1. Install the build tools
sudo apt update
sudo apt install build-essential bc bison flex libssl-dev libelf-dev libncurses-dev dwarves rsync fakeroot
2. Get the source
Either use the kernel source from the repository, which matches the kernel Parrot ships:
sudo apt install linux-source
ls /usr/src/ # shows linux-source-<version>.tar.xz
mkdir -p ~/kernel && cd ~/kernel
tar -xaf /usr/src/linux-source-*.tar.xz
cd linux-source-*/
or download a newer release from kernel.org and extract it the same way. Build in your home directory; you do not need root to compile.
3. Configure
Start from the configuration of the kernel you are running, so the new kernel supports the same hardware:
cp /boot/config-$(uname -r) .config
make olddefconfig
olddefconfig keeps your settings and answers any new options with their defaults. To change options, open the menu editor:
make menuconfig
The Debian-based configuration refers to signing certificates that are not part of the source tree. Clear those two settings, or the build stops with an error about missing certificate files:
scripts/config --set-str SYSTEM_TRUSTED_KEYS ""
scripts/config --set-str SYSTEM_REVOCATION_KEYS ""
4. Build the packages
make -j$(nproc) bindeb-pkg LOCALVERSION=-custom
bindeb-pkg compiles the kernel and wraps it in Debian packages; LOCALVERSION adds a suffix so you can tell your kernel apart from the stock one. When it finishes, the packages are in the parent folder:
ls ../*.deb
You will typically see linux-image-<version>-custom, linux-headers-<version>-custom and linux-libc-dev.
5. Install and boot
sudo dpkg -i ../linux-image-*-custom*.deb ../linux-headers-*-custom*.deb
sudo reboot
Installing the package updates GRUB automatically. After the reboot check which kernel is running:
uname -r
The headers package matters if you use out-of-tree drivers (for example the Nvidia driver or VirtualBox modules), which DKMS rebuilds against it.
Remove the custom kernel
Boot the stock kernel from the GRUB menu, then:
sudo apt remove linux-image-<version>-custom linux-headers-<version>-custom
Common problems
- No rule to make target ‘debian/certs/…’: clear the two certificate settings shown in step 3.
- Build killed or very slow: not enough memory for the number of parallel jobs. Lower it, for example
make -j2 bindeb-pkg. - Kernel panic at boot, “unable to mount root”: a driver needed for your disk or file system was turned off. Boot the stock kernel, compare your
.configwith the original and rebuild. - The kernel does not start with Secure Boot on: disable Secure Boot, or sign the kernel with your own enrolled key.
FAQ
Do I need a custom kernel for wireless auditing or Nvidia GPUs?
Usually not. Supported Wi-Fi adapters and the Nvidia driver work with the stock kernel. See supported Wi-Fi chipsets and Nvidia driver.
Will parrot-upgrade replace my kernel?
It installs new stock kernels next to yours but does not remove the custom one. GRUB boots the newest version by default, so pick yours under Advanced options if you want to keep using it.
How long does the build take?
With the full Debian configuration, roughly 20–40 minutes on a modern 8-core CPU and several hours on an older laptop. Turning off drivers you do not need with make localmodconfig makes it much faster.