Pcornel
Browse topics
Options
Recent
Favorites
Linux · Technical reference

Repositories · Debian / Ubuntu

Direct answer

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.

When to use this

Use it when adding a vendor repository, or when apt update fails with 404 or signature errors.

First 30 seconds

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.

Operational verification

repository defined → indexes downloaded and signature verified → packages available with priorities

Evidence · next step

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
Platform / version applicability
linux
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformlinux
Scope / prerequisiteUse it when adding a vendor repository, or when apt update fails with 404 or signature errors.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

5 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points

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.

Key checks
  • apt policy <pkg> / dnf info <pkg> — installed and candidate versions
  • dpkg -l <pkg> / rpm -q <pkg> — installed package
  • apt-cache depends <pkg> / dnf repoquery --requires <pkg> — dependencies
  • dpkg -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 (deb or deb-src), optional options in brackets, URI, suite and components, all on one line.
  • deb822 format (.sources, supported since APT 1.1): fields like Types:, URIs:, Suites:, Components: and Signed-By:. Several values are separated by spaces, and Enabled: no disables 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)

ComponentContent
mainFree software, supported by Debian
contribFree software depending on non-free parts
non-freeNon-free software
non-free-firmwareNon-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

StepExample
Download the vendor's keycurl -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 checkapt 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

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
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor doclinux current

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%
Technical changelog & impact

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.

Related reference impactReview these references after material technical changes when their shared boundary is affected.
Terminology layer

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.

Aliases that resolve here
apt repositoriesubuntu sources listdebian repository signed-byapt repository trust
Embedded reference data

Quick lookup tables

Repositories operational reference

Topic-specific lookup boundaries, proof limits and next-step Evidence for Repositories.

Lookup boundaryTopic-specific referenceOperational use
Scope / effective stateDebian/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 verificationPin 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 chainsource configuration → DNS/TLS/HTTP reachability → InRelease/Release metadata → signature/keyring trust → Packages indexes → APT origin/priority → candidate version → transaction → installed provenanceTrace requested/configured state through effective state to the observed workload result.
Failure boundaryRepository 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 evidenceCorrelated 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 provenanceUse this observation only for the specific claim it actually supports.
Evidence limitIt 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 checkContinue 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 boundaryRepositories
Topic pathPackage Management → Debian / Ubuntu → Repositories
Runtime stateDebian/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 chainsource 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 boundaryRepository 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 ruleProve which configuration source owns the state, then prove that the running consumer loaded or generated the intended state.
Confirmation

Confirm action

Continue?