§2023-11-07

  1. Step 1 – Enable source code repo
alexlai@hc4Bookworm:/$ cat /etc/apt/sources.list

deb http://deb.debian.org/debian/ bookworm main

deb-src http://deb.debian.org/debian/ bookworm main   <-- deb-src : Indicate that you need source code for .DEB files

deb http://security.debian.org/debian-security bookworm-security main
deb-src http://security.debian.org/debian-security bookworm-security main

# bookworm-updates, to get updates before a point release is made;
# see https://www.debian.org/doc/manuals/debian-reference/ch02.en.html#_updates_and_backports
deb http://deb.debian.org/debian/ bookworm-updates main
deb-src http://deb.debian.org/debian/ bookworm-updates main
  1. apt update

  2. apt source

apt install dpkg-dev, make sure that it was installed!

root@hc4Bookworm:/# apt-cache search linux-source   <-- do not use root, use normal user
linux-source - Linux kernel source (meta-package)
linux-source-6.1 - Linux kernel source for version 6.1 with Debian patches
root@hc4Bookworm:/# apt source linux-source-6.1
...
dpkg-source: info: applying features/all/ethernet-microsoft/0028-net-mana-Configure-hwc-timeout-from-hardware.patch
dpkg-source: info: applying features/all/ethernet-microsoft/0029-net-mana-Rename-mana_refill_rxoob-and-remove-some-em.patch
dpkg-source: info: applying features/all/ethernet-microsoft/0030-net-mana-Add-gdma-stats-to-ethtool-output-for-mana.patch
W: Download is performed unsandboxed as root as file 'linux_6.1.55-1.dsc' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
alexlai@hc4Bookworm:~/build/src$ ls
linux-6.1.55  linux_6.1.55-1.debian.tar.xz  linux_6.1.55-1.dsc  linux_6.1.55.orig.tar.xz