compile, install, remove

created onJanuary 19, 2022

preparations

  • get kernel sources tarball from kernel.org
  • copy tarball to /usr/src/linux and extract it
  • cd into dir linux-<version>, created during extracting of the kernel tarball
  • copy /boot/config-<version>/.config or run ‘make olddefconfig’
  • run ‘make menuconfig’, edit config, save config and exit

compiling

make-kpkg --initrd --append-to-version=-customname kernel_image kernel_headers

installing the new kernel

dpkg -i ../linux-*.deb

kernel removal

kernel has been built with make-kpkg or make deb-pkg

list the kernels installed with

dpkg --get-selections | grep linux-image
.

remove the kernel with

apt-get remove linux-image-<version>-<arch>
.