Package Repositories
100%

Packages · Lesson 2

Package Repositories

Learn how repositories publish signed package indexes and how APT discovers configured Debian-family sources.

A package repository publishes packages together with indexes and release metadata. A package manager downloads those indexes, selects versions compatible with its configured distribution and architecture, verifies repository authentication, and retrieves the required package files.

Repository Metadata and Local Catalogs

A repository is more than a directory of archives. Its metadata describes available package names, versions, architectures, checksums, dependencies, and repository sections. The client caches a local catalog so it can search and resolve packages without downloading every archive first.

On a Debian-family system, refresh configured metadata with:

$ sudo apt update

This updates the local package indexes; it does not by itself install all available upgrades. Review the reported sources and authentication errors rather than ignoring failed entries.

What does apt update primarily refresh?

APT Source Configuration

APT reads configured sources from both:

  • /etc/apt/sources.list
  • files ending in .list or .sources under /etc/apt/sources.list.d/

The .list extension uses the traditional one-line format. The .sources extension uses deb822-style stanzas, which current APT documentation recommends for new configurations. A distribution can place its default sources in either location, so /etc/apt/sources.list is not guaranteed to contain the complete or primary configuration.

A deb822-style source can resemble:

Types: deb
URIs: https://deb.example.invalid/repository
Suites: stable
Components: main
Signed-By: /etc/apt/keyrings/example.gpg

This is syntax illustration only; the reserved .invalid domain is not a usable repository.

Where can APT read active repository definitions?

Repository Authentication

APT verifies signed repository release metadata, then checks downloaded package files against the authenticated checksums in that metadata. Signed-By can scope a source to a specific keyring instead of trusting every globally configured key for that repository.

A valid signature establishes that the metadata came from a holder of an accepted signing key and was not modified undetected. It does not prove that the publisher's software is defect-free, nonmalicious, or appropriate for the system. Confirm the key fingerprint and source instructions through an independent trusted channel.

What is the security purpose of Signed-By in an APT source definition?

Adding Third-Party Sources Deliberately

A repository can install packages and lifecycle scripts with system privileges, so adding one extends the system's software trust boundary. Before doing so:

  1. Prefer the distribution repository when it meets the requirement.
  2. Confirm the publisher, supported release, architecture, and signing-key fingerprint.
  3. Use a dedicated source file and scoped keyring.
  4. Inspect package names and dependency changes before installation.
  5. Document how to disable the source and migrate or remove its packages.

Do not copy obsolete instructions that disable signature checks or pipe an unaudited remote script into a privileged shell.

Why does adding a third-party repository expand the system's trust boundary?

Lesson complete

You finished Package Repositories

You can now explain how a configured repository becomes trusted package metadata.

  • Distinguish repository indexes from package archives.

  • Use apt update to refresh the local catalog.

  • Locate both one-line and deb822-style APT source definitions.

  • Scope signing keys and review third-party trust deliberately.

Keep your learning progress

Create a free account to save this lesson and continue learning on any device.

Create a free account
Next Lesson
Back to Packages