#!/bin/sh
set -euC

# https://wiki.ubuntu.com/Debug%20Symbol%20Packages#Getting_-dbgsym.ddeb_packages

codename="${1:-"$(lsb_release -cs)"}"

url="http://ddebs.ubuntu.com"

printf "" | sudo tee /etc/apt/sources.list.d/ddebs.list
for suffix in "" "-updates" "-proposed"
do
    printf '%s\n' \
        "deb $url $codename$suffix main restricted universe multiverse" \
    | sudo tee -a /etc/apt/sources.list.d/ddebs.list
done

sudo apt-get install ubuntu-dbgsym-keyring
sudo apt-get update

# For `find-dbgsym-packages`.
sudo apt-get install debian-goodies elfutils