Skip to content

Instantly share code, notes, and snippets.

@yskzalloc
Last active August 15, 2026 20:42
Show Gist options
  • Select an option

  • Save yskzalloc/0d2a839fa169505e7c6ef35b7b0ca457 to your computer and use it in GitHub Desktop.

Select an option

Save yskzalloc/0d2a839fa169505e7c6ef35b7b0ca457 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# References:
# https://wiki.debian.org/HowToGetABacktrace#Installing_the_debugging_symbols
# https://wiki.debian.org/AutomaticDebugPackages
# sudo apt install kdump-tools crash
set -e
# Ensure lsb_release is available
if ! command -v lsb_release >/dev/null 2>&1; then
sudo apt-get update && sudo apt-get install -y lsb-release
fi
CODENAME="$(lsb_release -cs)"
# Add the Debian Debug repositories
cat <<EOF | sudo tee /etc/apt/sources.list.d/debian-debug.list
deb http://deb.debian.org/debian-debug/ ${CODENAME}-debug main contrib non-free non-free-firmware
deb http://deb.debian.org/debian-debug/ ${CODENAME}-proposed-updates-debug main contrib non-free non-free-firmware
EOF
sudo apt-get update
# Install matching kernel debug symbols (approx. 600MB–1GB)
sudo apt-get install -y "linux-image-$(uname -r)-dbg"
# Verify location of uncompressed vmlinux image with debug info
dpkg -L "linux-image-$(uname -r)-dbg" | grep vmlinux
# Install kdump related tools
sudo apt-get install -y kdump-tools crash gdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment