LinuxCommandLibrary

extrepo

Manage external software repositories easily

TLDR

Search for a given package

$ extrepo search [package]
copy

Enable the repository
$ sudo extrepo enable [repository_name]
copy

Disable the repository
$ sudo extrepo disable [repository_name]
copy

Update the repository
$ sudo extrepo update [repository_name]
copy

SYNOPSIS

extrepo command [ options ] [ arguments ]

Common commands include:
extrepo add name [ url ] [ components... ]
extrepo remove name
extrepo list
extrepo enable name
extrepo disable name
extrepo refresh
extrepo update
extrepo version

PARAMETERS

add name [ url ] [ components... ]
    Adds a new external repository definition. It requires a unique name, an optional url (if not inferred), and a list of components (e.g., `main`, `contrib`).

remove name
    Removes an existing external repository definition.

list
    Lists all configured external repositories, indicating their status (enabled/disabled).

enable name
    Enables a previously disabled repository, making it active for APT.

disable name
    Disables an active repository, preventing APT from using it without removing its configuration.

refresh
    Refreshes extrepo's internal cache of repository definitions.

update
    Performs an APT update (`apt update`) after making changes to repositories, ensuring APT's package lists are current.

version
    Displays the installed version of extrepo.

--no-check-gpg
    (Applicable to `add` command) Skips the GPG signature verification during repository addition. Use with extreme caution as it compromises security.

--arch architectures
    (Applicable to `add` command) Specifies a comma-separated list of architectures (e.g., 'amd64,i386') for which the repository should provide packages.

--force
    (Applicable to `remove` command) Forces the removal of a repository, bypassing certain warnings or interactive prompts.

DESCRIPTION

extrepo is a powerful command-line utility designed to simplify the management of external software repositories on Debian-based Linux distributions. It provides a structured and declarative way to add, remove, enable, and disable third-party APT sources, moving beyond manual modifications of `sources.list` files. A key feature is its ability to handle associated GPG keys, either by automatically importing them or by utilizing the `signed-by` mechanism, which enhances security and trust by verifying package signatures. extrepo stores repository definitions in the `/etc/extrepo.d/` directory, using the `deb822` format, and manages their presence in `/etc/apt/sources.list.d/` via symlinks. This approach helps maintain a cleaner and more organized system, making it easier to track and update external software. It's particularly useful for developers and users who frequently rely on software not available in the main distribution archives, providing a safer and more maintainable way to integrate such packages. extrepo automates the necessary steps, including fetching GPG keys and updating APT's cache, streamlining the process of adding new software sources. extrepo is part of the `extrepo` package, ensuring it integrates well with the system's package management.

CAVEATS

Root privileges are required to use extrepo effectively, as it modifies system-wide APT configuration files. Adding untrusted or poorly maintained repositories can introduce significant security risks and system instability, potentially leading to package conflicts or system breakage. Always verify the trustworthiness of a source before adding it. GPG key issues, while often handled by extrepo, can still occur if keys are unavailable or revoked, preventing package installation or updates. Compatibility across different Debian/Ubuntu releases for external repositories is not guaranteed and can sometimes lead to issues.

<B>DEB822 FORMAT AND CONFIGURATION LOCATION</B>

extrepo stores its repository definitions in `/etc/extrepo.d/` using the `deb822` format, a modern and more expressive format for APT sources. These definitions are then linked into `/etc/apt/sources.list.d/` via symlinks, making them active for APT. This structured approach helps in maintaining a clean and organized overview of external sources, distinguishing them from manually added entries.

<B>COMPARISON WITH ADD-APT-REPOSITORY</B>

While both extrepo and add-apt-repository (from the `software-properties-common` package) facilitate adding external repositories, they serve slightly different niches. `add-apt-repository` is predominantly focused on managing Launchpad PPAs (Personal Package Archives) and automatically handles their GPG keys. extrepo offers a more general-purpose solution for adding any APT repository, including non-PPA sources, and provides explicit control over components and architectures. It emphasizes a declarative configuration and robust GPG key handling, often using the `signed-by` option for enhanced security.

HISTORY

extrepo emerged as part of the ongoing evolution of APT and repository management in Debian and Ubuntu. It addresses the need for a more declarative, structured, and secure way to handle external repositories beyond simple manual edits or the PPA-centric `add-apt-repository`. Its development gained traction with the adoption of the `deb822` format for `sources.list` entries, which provides more flexibility and better metadata handling. By managing repository definitions in `/etc/extrepo.d/` and using symlinks to `sources.list.d/`, extrepo offers a cleaner alternative, especially when managing multiple external sources not necessarily hosted on Launchpad PPAs. It aims to streamline GPG key management by either automatically fetching them or supporting the `signed-by` directive, aligning with modern APT security practices and making it easier to ensure package authenticity.

SEE ALSO

apt(8), apt-get(8), add-apt-repository(1), sources.list(5), gpg(1)

Copied to clipboard