← Knowledge Base
DebianReference note1 min read · updated 2026-11-27

Debian apt sources and adding a third-party repository

Where apt reads repositories, release names, and the modern way to add a signed repository.

aptrepositoriesgpg

Repositories are listed in /etc/apt/sources.list and in /etc/apt/sources.list.d/ (either one-line .list files or the newer deb822 .sources format). Check your release with cat /etc/os-release.

To add a third-party repository, store its signing key under /etc/apt/keyrings/ and reference it with signed-by; do not use the deprecated apt-key:

sudo install -d -m 0755 /etc/apt/keyrings
curl -fsSL https://example.org/key.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/example.gpg
echo "deb [signed-by=/etc/apt/keyrings/example.gpg] https://example.org/apt stable main" | sudo tee /etc/apt/sources.list.d/example.list
sudo apt update

Only add repositories you trust: packages run as root during installation. Mixing releases (for example stable plus testing) can break dependencies; use pinning (/etc/apt/preferences.d/) if you must.