APT deb822 sources — Repository selection
A .sources file uses deb822 stanzas separated by blank lines. Types selects binary or source packages; URIs selects archive locations; Suites selects distribution branches; Components selects subdivisions. Signed-By restricts accepted repository signing keys: use a verified keyring readable by the APT sandbox user. Enabled: no disables a stanza; absent means enabled. Legacy .list entries coexist with .sources files. Source order can break ties for identical versions; APT preferences and version selection are separate. Conflicting options for the same archive and suite can be rejected. Do not substitute the example domain or keyring into production. Keep the previous source file, review the intended release and signing-key fingerprint, validate offline, then perform an authorized metadata refresh and inspect package policy. Restoring sources does not undo already-installed packages.
Formal Syntax & Structure
Types: debURIs: https://repo.example/debianSuites: stableComponents: mainSigned-By: /usr/share/keyrings/example.gpgEnabled: noParameters & Attributes
| Name | Type | Description |
|---|---|---|
| Types | directive or field | deb or deb-src |
| URIs | directive or field | Archive base addresses |
| Suites | directive or field | Suite or exact archive path |
| Components | directive or field | Archive subdivisions for ordinary suites |
| Signed-By | directive or field | Scoped trusted keyring or fingerprint |
| Enabled | directive or field | Enable or disable stanza |
Return Value
Repository declarations; no signature or connectivity proof.
Working Example
set -eud=$(mktemp -d)trap 'rm -rf -- "$d"' EXITmkdir "$d/parts" "$d/lists"cat > "$d/parts/demo.sources" <<'EOF'Types: debURIs: https://repo.example/debianSuites: stableComponents: mainSigned-By: /usr/share/keyrings/example.gpgEOFapt-get -o Dir::Etc::sourcelist=/dev/null -o Dir::Etc::sourceparts="$d/parts" -o Dir::State::lists="$d/lists" indextargets --no-release-info > "$d/targets"grep -F 'https://repo.example/debian/dists/stable/main/' "$d/targets" >/dev/nullprintf 'private source parsed; no metadata fetched\n'