How to Use extrepo in Debian to Manage Third-Party Repositories

Learn how to use Debian’s extrepo command to easily add, search, and manage external APT repositories without manual configuration.

What if I told you Debian has a great little tool that takes the hassle out of manually setting up extra software repositories? So, when you want to install apps that aren’t usually found in the default repositories—like Google Chrome, Brave Browser, or VS Code—it’s ready to help you out. I’m talking about the extrepo tool.

What’s extrepo Tool?

The Debian extrepo tool is a command-line utility designed to make it easier and safer for users to enable external repositories that aren’t part of the official Debian archive.

In other words, instead of manually hunting down repository URLs, GPG keys, and configuration instructions—extrepo automates the process using a curated list of vetted sources maintained by the Debian project.

The key phrase here is “a curated list of vetted sources.” In other words, extrepo isn’t some magic tool that lets you install absolutely anything you can dream up. Instead, it gives you access to a relatively small set of repositories that Debian developers have already prepared and tested for your specific Debian version.

To see what’s available, just follow this link, choose your Debian release—say, Trixie—and check out the predefined software repositories it offers.

How to Use the extrepo Tool in Debian

At its core, extrepo works with a catalog of third-party repositories stored in “/usr/share/extrepo/repos.d/.” This catalog contains metadata about each repository, including its name, description, URL, signing key, and any special setup steps. Now let me show you how you can use it in practice.

Installation

Installing the extrepo tool—which isn’t included in the default Debian setup—couldn’t be easier. You just need to run one simple APT command, and you’re all set.

sudo apt install extrepoCode language: Bash (bash)
Installing the extrepo tool on Debian.
Installing the extrepo tool on Debian.

Open the file “/etc/extrepo/config.yaml” in your favorite terminal text editor. Find the lines with “– contrib” and “– non-free,” and remove the “#” at the start of each line, along with the space that follows it, then save your changes and close the editor.

sudo nano /etc/extrepo/config.yamlCode language: Bash (bash)
Enable policies.
Enable policies.

The updated section should look like this:

---
url: https://extrepo-team.pages.debian.net/extrepo-data
dist: debian
version: trixie
# To enable repositories that host software with non-DFSG-free licenses,
# uncomment "contrib" and/or "non-free" in the list below.
enabled_policies:
- main
- contrib
- non-freeCode language: YAML (yaml)

Why did we do this? When using Debian’s extrepo command, the “/etc/extrepo/config.yaml” file defines which categories of software repositories the tool is allowed to enable on your system. By default, only repositories marked as “main“—which contain DFSG-free software—are permitted.

However, if you want access to repositories that fall under “contrib” (free software that depends on non-free components) or “non-free” (software that doesn’t meet Debian’s free software guidelines, such as proprietary drivers or applications), you must explicitly enable them in this configuration file.

If you don’t make the changes mentioned above, some repositories, such as Google Chrome, VS Code, and so on, will show a message saying they can’t be added to your system.

Finding External Repositories

Now, let’s take a look at how to search for a specific repository. All you need to do is run the extrepo search command followed by the software name. For example, if you want to see whether Google Chrome is available, you’d run:

extrepo search google_chromeCode language: Bash (bash)
Search for repository.
Search for repository

Great, we can see that Google Chrome’s browser repository is available. The tricky part, though, is that we don’t always know the exact name of a repository. If you type it wrong, the extrepo command might tell you it can’t be found—even though it’s actually there.

To avoid that hassle, a much more reliable approach is to browse the list of available repositories yourself (after choosing the right Debian release). That way, you’ll see the exact names and won’t run into guesswork.

Enable External Repositories with Debian’s extrepo Tool

Before you can use a repository on Debian, you’ll need to add/enable it first. That’s where the extrepo enable command comes in. For example, here’s how you’d use it to set up the Google Chrome repository.

sudo extrepo enable google_chromeCode language: Bash (bash)
Enable an external repository on Debian.
Enable an external repository on Debian.

After the command runs successfully, you won’t see any output. It automatically configures the official Google repository for the Chrome browser, including importing the signing key.

Now, if you refresh the software list, you’ll notice the new repository is now available to APT so that you can install software from it.

The Google Chrome repository has been added and enabled successfully on Debian.
The Google Chrome repository has been added and enabled successfully on Debian.

So, you’re all set to install the software you want.

sudo apt install google-chrome-stableCode language: Bash (bash)
Installing software from the newly added Debian external repository.
Installing software from the newly added Debian external repository.

Lastly, just for your information, the stored repo GPG keys used to verify packages from those external repositories live under the “/var/lib/extrepo/keys” directory.

Disable External Repositories with Debian’s extrepo Tool

Disabling unused or untrusted external repositories is a good security and stability practice. It prevents unnecessary updates from outside sources and ensures that your system only pulls packages from trusted origins.

Disabling a repository, previously enabled with the extrepo command, is a pretty simple job. Just run the command below, followed by the repo name. For example, to turn off the Google Chrome external repo:

sudo extrepo disable google_chromeCode language: Bash (bash)

Like the “enable” option, the command doesn’t show any output when you run it. But if you check the repo configuration file, you’ll see that it’s been disabled.

Disable an external repository on Debian.
Disable an external repository on Debian.

If you want to remove the repo completely, go ahead and delete its “.source” configuration file.

sudo rm /etc/apt/sources.list.d/extrepo_google_chrome.sourcesCode language: Bash (bash)

You can also remove the GPG key that’s used to sign packages from this repository.

sudo rm /var/lib/extrepo/keys/google_chrome.ascCode language: Bash (bash)

Finally, refresh your system’s package information.

sudo apt updateCode language: Bash (bash)

Updating Repository Metadata

Over time, the repository metadata that extrepo relies on may change—for example, new repositories might be added, existing ones updated, or cryptographic keys rotated. That’s where the extrepo update command comes in.

sudo extrepo updateCode language: Bash (bash)

This tells extrepo to refresh its local database of available repositories. Keep in mind that this rewrites the APT configuration file for all repos, as well as the GPG keyring for it.

Important note: extrepo update doesn’t update your system packages (that’s apt update); instead, it updates extrepo’s knowledge base of external repositories, making sure you always have the freshest definitions to work with.

Conclusion

As you can see, Debian’s extrepo tool is all about making life easier when it comes to handling third-party repositories. Instead of digging around for URLs, keys, and setup instructions, you get a simple, reliable way to add, update, and remove extra sources directly from the terminal.

It’s safe, fast, and it keeps your system cleaner by relying on a curated list of vetted repositories. So, if you’re a Debian user who likes to extend your system beyond the official archives, extrepo is a utility you’ll want in your toolbox.

For more information, visit its man page in the official Debian documentation.

Thank you for your time! I hope you find this guide helpful. As always, any feedback is much appreciated.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Leave a Reply

Your email address will not be published. Required fields are marked *