Use it when adding a vendor repository, or when apt update fails with 404 or signature errors.
Repositories · Debian / Ubuntu
APT repositories are sources of packages defined in /etc/apt/sources.list or .sources/.list files in /etc/apt/sources.list.d/, each with a URI, suite (e.g. noble, bookworm) and components, signed by a key.
1. apt update 2>&1 | grep -E 'Err|W:' — which repo fails?
2. 404 → wrong suite/codename or URL.
3. NO_PUBKEY / signature error → key missing or wrong signed-by.
4. apt policy <pkg> — which repo is chosen?
5. Fix the .list/.sources file and rerun apt update.
repository defined → indexes downloaded and signature verified → packages available with priorities
For Package Management → Debian / Ubuntu → Repositories, continue with the first unproven Topic check: Enumerate effective source entries, suites, components, architectures and Signed-By/keyring references. If that boundary is healthy, advance to the adjacent check: Validate repository metadata retrieval and signature/trust errors with timestamps. Preserve the same host/time/identity scope and rerun the original workload before accepting recovery.
Continue only after interpreting the current observation.Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
source configuration → DNS/TLS/HTTP reachability → InRelease/Release metadata → signature/keyring trust → Packages indexes → APT origin/priority → candidate version → transaction → installed provenance
Healthy evidence: effective source entries are intentional, metadata is current and cryptographically trusted, package origin is understood and candidate selection matches policy.
Step 2 Verification and output interpretation Verify boundary
Existing fast checks for this Topic. - Enumerate effective source entries, suites, components, architectures and Signed-By/keyring references.
- Validate repository metadata retrieval and signature/trust errors with timestamps.
- Inspect package origin and policy priority for the exact package/version.
- Disable or change a source only after proving its role, then refresh metadata and re-check candidate selection.
Verification chain. source configuration → DNS/TLS/HTTP reachability → InRelease/Release metadata → signature/keyring trust → Packages indexes → APT origin/priority → candidate version → transaction → installed provenance
Step 3 Commands Verify boundary
ls /etc/apt/sources.list.d/
apt-cache policy
gpg --show-keys /etc/apt/keyrings/*.gpg
Step 4 Failure modes and next checks Narrow the fault
Suspicious evidence: an obsolete codename, mixed release, expired/missing signing key or unintended PPA silently changes candidate availability or blocks metadata refresh.
Step 5 Common mistakes Narrow the fault
- Using deprecated
apt-key. - Mixing releases (e.g. bookworm and trixie).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
Use the release codename that matches the system (. /etc/os-release; echo $VERSION_CODENAME). Keys belong in /etc/apt/keyrings with signed-by= — apt-key is deprecated. Pin priorities in /etc/apt/preferences.d control which repo wins.
apt policy <pkg> / dnf info <pkg>— installed and candidate versionsdpkg -l <pkg> / rpm -q <pkg>— installed packageapt-cache depends <pkg> / dnf repoquery --requires <pkg>— dependenciesdpkg -S <file> / rpm -qf <file>— package owning a file
ReferenceWhat it is1 section · depth on demand
Core model
Inventory every effective source entry including deb822 and traditional formats, release suite/codename, component and architecture filter. Correlate fetched InRelease/Release metadata with configured keyring or Signed-By trust. Treat third-party repositories and PPAs as explicit supply-chain boundaries. Metadata freshness, mirror consistency and package origin must be checked before diagnosing solver behavior.
ReferenceImportant terms & boundaries5 sections · depth on demand
What this shows and what it does not
Repository checks show configured origin, metadata retrieval and trust status, not that APT selects that origin or that installed software is safe/healthy.
In depth
APT repositories: sources.list and deb822 files
APT knows where to fetch packages from through source definitions. The sources.list(5) manual page documents two formats:
- One-line format (
.list): type (debordeb-src), optional options in brackets, URI, suite and components, all on one line. - deb822 format (
.sources, supported since APT 1.1): fields likeTypes:,URIs:,Suites:,Components:andSigned-By:. Several values are separated by spaces, andEnabled: nodisables a stanza.
Extra files go into /etc/apt/sources.list.d/. Their names must end in .list or .sources, and may contain only letters, digits, underscores, hyphens and periods.
Components (Debian)
| Component | Content |
|---|---|
| main | Free software, supported by Debian |
| contrib | Free software depending on non-free parts |
| non-free | Non-free software |
| non-free-firmware | Non-free firmware (from Debian 12) |
Ubuntu uses main, restricted, universe and multiverse.
Signed-By (manual)
Signed-By limits a repository to specific keys, instead of trusting every key the system has. The manual recommends /usr/share/keyrings for keyrings managed by packages, and /etc/apt/keyrings for keyrings added by the administrator. The keyring files must be readable by the _apt user.
Adding a third-party repository
| Step | Example |
|---|---|
| Download the vendor's key | curl -fsSL https://repo.example.com/key.asc -o /etc/apt/keyrings/example.asc |
| Add a deb822 file | /etc/apt/sources.list.d/example.sources |
| Refresh and check | apt update; apt policy <pkg> |
host$ cat /etc/apt/sources.list.d/example.sources
Types: deb
URIs: https://repo.example.com/debian
Suites: bookworm
Components: main
Architectures: amd64
Signed-By: /etc/apt/keyrings/example.asc
host$ sudo install -d -m 0755 /etc/apt/keyrings
host$ sudo curl -fsSL https://repo.example.com/key.asc -o /etc/apt/keyrings/example.asc
host$ sudo apt update 2>&1 | grep -i example
Get:5 https://repo.example.com/debian bookworm InRelease [3,512 B]
host$ apt policy example-agent | head -4
host$ ls /etc/apt/sources.list.d/
host$ grep -rh "^deb \|^URIs:" /etc/apt/sources.list /etc/apt/sources.list.d/
Why not apt-key
The old apt-key add put every key into one global keyring, trusted for all repositories. A compromised third-party key could then sign packages that appear to come from the distribution. Signed-By with a separate keyring per repository removes that risk.
Documented example, not captured output.
How it works at runtime
Repositories is part of Package Management → Debian / Ubuntu → Repositories. Debian/Ubuntu repositories define package origins and metadata through configured source entries, suites/codenames, components, architectures and cryptographic signing trust; source reachability and source authenticity are distinct properties.
Topic-specific state model. Debian/Ubuntu repositories define package origins and metadata through configured source entries, suites/codenames, components, architectures and cryptographic signing trust; source reachability and source authenticity are distinct properties.
Interpretation rule. - HTTP/TLS reachability ≠ APT repository signature trust.
- Signed repository metadata ≠ every package is appropriate for this host.
- Repository enabled ≠ its package wins candidate selection.
- Same package name across sources ≠ same provenance.
Quick reference
APT repositories use deb822 .sources files (Ubuntu 24.04+, Debian 12+) or one-line .list files, with signing keys referenced per repository:
# /etc/apt/sources.list.d/nginx.sources
Types: deb
URIs: https://nginx.org/packages/ubuntu
Suites: noble
Components: nginx
Signed-By: /usr/share/keyrings/nginx-archive-keyring.gpg
curl -fsSL https://nginx.org/keys/nginx_signing.key | gpg --dearmor -o /usr/share/keyrings/nginx-archive-keyring.gpg
apt update
apt-key is deprecated — keys trusted globally could sign packages for any repository. Use Signed-By so each key only validates its own repository.
Limits and how it fails
Primary failure point. Repository checks show configured origin, metadata retrieval and trust status, not that APT selects that origin or that installed software is safe/healthy.
ReferenceConfiguration & state1 section · depth on demand
Configuration, persistence and lifecycle
Distribution/platform context. Debian/Ubuntu Repositories owns source definitions, repository metadata and signing trust. APT owns candidate policy/solver behavior; broader TLS/DNS/network troubleshooting stays in the relevant Topics.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Package Management → Debian / Ubuntu → Repositories. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.debian.org/doc/manuals/debian-reference/ch02.en.html · confidence 94%What changed and what may be affected
Recent technical edits are separated from ordinary page timestamps. Relationship impact is advisory: it identifies nearby canonical references to review, not automatic breakage.
Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Repositories operational reference
Topic-specific lookup boundaries, proof limits and next-step Evidence for Repositories.
| Lookup boundary | Topic-specific reference | Operational use |
|---|---|---|
| Scope / effective state | Debian/Ubuntu repositories define package origins and metadata through configured source entries, suites/codenames, components, architectures and cryptographic signing trust; source reachability and source authenticity are distinct properties. | Establish exactly what this Topic owns before crossing into another subsystem. |
| Fast verification | Pin host + distribution/release + architecture → identify exact package/version request → enumerate effective repositories/trust → refresh/inspect metadata → compare installed versus candidate/origin → review dependency/conflict transaction → capture package-manager transaction → verify local package database/files/scripts → inspect service/reboot/config effects → repeat original workload test. | Use the shortest evidence path first; a fast check is a boundary test, not blanket proof. |
| Verification chain | source configuration → DNS/TLS/HTTP reachability → InRelease/Release metadata → signature/keyring trust → Packages indexes → APT origin/priority → candidate version → transaction → installed provenance | Trace requested/configured state through effective state to the observed workload result. |
| Failure boundary | Repository checks prove configured origin, metadata retrieval and trust status, not that APT selects that origin or that installed software is safe/healthy. | Stop broad troubleshooting at the first boundary that is not supported by evidence. |
| Positive evidence | Correlated Linux package-management evidence can establish this proof path: source configuration → DNS/TLS/HTTP reachability → InRelease/Release metadata → signature/keyring trust → Packages indexes → APT origin/priority → candidate version → transaction → installed provenance | Use this observation only for the specific claim it actually supports. |
| Evidence limit | It does not independently prove behavior outside the captured repository, solver, transaction, local package database, runtime-side-effect or workload scope. Repository checks prove configured origin, metadata retrieval and trust status, not that APT selects that origin or that installed software is safe/healthy. | Do not promote a local success signal into end-to-end or adjacent-dependency proof. |
| Next troubleshooting check | Continue from the first unproven boundary: confirm distribution/release and repository trust, inspect candidate/origin and solver policy, correlate the package-manager transaction with dpkg/RPM local state, then test affected services and the original workload before making additional package changes. | Continue to the next unresolved boundary while preserving the original test condition. |
Repositories · operational reference
Compact Linux state, persistence, verification and boundary reference for fast lookup.
| Reference boundary | Repositories |
|---|---|
| Topic path | Package Management → Debian / Ubuntu → Repositories |
| Runtime state | Debian/Ubuntu repositories define package origins and metadata through configured source entries, suites/codenames, components, architectures and cryptographic signing trust; source reachability and source authenticity are distinct properties. |
| Fast checks | - Enumerate effective source entries, suites, components, architectures and Signed-By/keyring references. - Validate repository metadata retrieval and signature/trust errors with timestamps. - Inspect package origin and policy priority for the exact package/version. - Disable or change a source only after proving its role, then refresh metadata and re-check candidate selection. |
| Verification chain | source configuration → DNS/TLS/HTTP reachability → InRelease/Release metadata → signature/keyring trust → Packages indexes → APT origin/priority → candidate version → transaction → installed provenance Boundary chain: local authoritative state → adjacent dependency → effective/programmed state → original workload/request → return/regression → explicit Evidence boundary. |
| Failure boundary | Repository checks prove configured origin, metadata retrieval and trust status, not that APT selects that origin or that installed software is safe/healthy. Boundary chain: repository/metadata → dependency resolution → artifact/signature → package database/file install → scriptlets → service/process reload → effective binary/config → workload. |
| Persistence rule | Prove which configuration source owns the state, then prove that the running consumer loaded or generated the intended state. |