Some applications may not be in the official repositories of your operating system. In this post I will show you some of the most popular (and reliable) community-based repositories for Ubuntu, Arch Linux, Fedora, etc. and how to add them.

Note: The process of adding repositories always need to be executed as root or by using ‘sudo’.

Table of Contents

Debian

Adding a repo

There are several ways to add a third-party repository in Debian (always follow the official repo instructions). It can be as simple as adding the repository URL to a new line in /etc/apt/sources.list or in a new file inside /etc/apt/sources.list.d/ (recommended).

# /etc/apt/sources.list.d/newrepo.list
deb http://example.com/debian-repo bullseye

Changing from stable to testing

For example, to add the Debian ‘testing’ repository (current development of the next stable Debian release) you need to replace the ‘stable’ repository (marked as ‘stable’ or with the codename of the installed Debian release, such as ‘bullseye’) with the ‘testing’ (marked as ‘testing’ or with the codename of the next stable Debian release):

# /etc/apt/sources.list

# deb http://deb.debian.org/debian bullseye main
deb http://deb.debian.org/debian testing main
  • Remember to replace the rest of the official repos from ‘stable’ to ‘testing’ (e.g.: debian-security):
    deb http://deb.debian.org/debian-security testing-security main
    

Backports

Backports repository provides recompiled packages from ‘testing’ (mostly) and a few from ‘unstable’, while remains compatible with the ‘stable’ repositories. Append this line (replacing <codename> with the codename of the installed Debian, such as ‘bullseye’) in /etc/apt/sources.list:

deb http://deb.debian.org/debian <codename>-backports main contrib non-free
  • You can change non-free with free to only get open source packages.

Signed repositories

Nowadays, repositories are signed using an OpenPGP key to ensure the authenticity of the packages. In these cases, you need to add the key to /usr/share/keyrings/ before adding the repository. The process of adding the key may differ depending on the repository (remember to always follow repository instructions), because some keys are distributed as ‘ascii-armored’ and that requires to ‘dearmor’ them using gpg:

wget -O /usr/share/keyrings/repo-key.gpg https://example.com/repo-key.gpg
# ascii-armored key
curl https://example.com/repo-key.gpg | gpg -o /usr/share/keyrings/repo-key.gpg --dearmor

After adding the key, you must specify that the repo is signed with a key when adding the repo file in /etc/apt/sources.list.d/:

# /etc/apt/sources.list.d/newrepo.list
deb [signed-by=/usr/share/keyrings/repo-key.gpg] https://example.com/debian-repo bullseye

Update the repository info

After adding the repo URL, run apt update to download package information from the new repository.

MPR - Mist

Makedeb Package Repository (https://mpr.makedeb.org/) is a community-maintained repository (similar to AUR) for the makedeb packaging tool. In order to install packages from MPR, you need a “helper” (in addition to makedeb): Mist is the official command-line interface for the MPR.

Follow the instructions on the website to install Mist (basically the steps are adding the repository and installing mist with apt). After that, you can simply run mist install <package name> to install a package

Ubuntu

Adding a repo

It’s the same process as in Debian. You can also use the graphical “Software and Updates” tool.

PPA (Personal Package Archives) are a kind of repository. To add them, you need to have python-software-properties installed on the system. Then, to add the PPA, run:

add-apt-repository ppa:user/ppa-name

Finally, as in Debian, update the package information by running apt update.

Pacstall

Pacstall is a package manager inspired on AUR (Arch User Repository). Pacstall takes in files known as pacscripts (similar to AUR PKGBUILD’s) that contain the necessary contents to build packages, and builds them into executables on your system. To install Pacstall, follow the instructions on their website.

Fedora/RHEL and RHEL-clones

Adding a repo

Repositories commonly provide their own .repo file. In this case, to add (and enable) the repo, run:

dnf config-manager --add-repo /etc/yum.repos.d/myrepo.repo
  • You need to have dnf-plugins-core installed to use config-manager.

If that’s not the case, create a file with the .repo suffix inside /etc/yum.repos.d/. This is the syntax of a repository file:

# /etc/yum.repos.d/myrepo.repo

[repository]
name=repo_name
baseurl=repo_url
  • Replace repository with a unique repository ID (such as my_repo, do not use spaces), repo_name with the repository name and repo_url with the repo URL (NOT the .repo file URL).

After that, add (and enable) the configured repository:

dnf config-manager --add-repo /etc/yum.repos.d/myrepo.repo
  • You need to have dnf-plugins-core installed to use config-manager.

RPM Fusion

RPM Fusion provides software that Fedora (or Red Hat) doesn’t want to ship (because isn’t open source, for example). The software is provided as pre-compiled RPMs. RPM Fusion has two separate repositories: ‘free’ (for open source software) and ‘nonfree’ for software that is not open source.

Check https://rpmfusion.org/Configuration to know how to enable RPM Fusion on your device. This is the default installation process for Fedora using dnf:

dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

Copr

Copr is an automatic build system for Fedora. Developers provide a src.rpm and Copr provides a YUM repository. Users who want to install a package built in Copr, just need to add the repository using dnf (check for the ‘Active Releases’ section on the developer’s Copr repo page):

dnf config-manager --add-repo https://copr.fedorainfracloud.org/coprs/kwizart/kernel-longterm-5.15/repo/fedora-36/kwizart-kernel-longterm-5.15-fedora-36.repo

Then install the package as usual.

EPEL

EPEL (Extra Packages for Enterprise Linux) is a repository of a high-quality set of additional packages for RHEL, CentOS, Rocky Linux, Alma Linux and other systems. You can install EPEL easily with dnf:

  • Enable ‘CRB’ repo (this is needed in order to install some EPEL packages):
    dnf config-manager --set-enabled crb
    
  • Install EPEL
    dnf install epel-release
    

Arch Linux

Adding a repo

Create a file inside /etc/pacman.d/ and add the repo info:

# /etc/pacman.d/myrepo
Server = repo_url

Then, edit /etc/pacman.conf to add the repo to the list:

[repo-name]
Include = /etc/pacman.d/myrepo

AUR

AUR (Arch User Repository) is a community-based repository where developers upload build instructions for their apps (PKGBUILDS) the user can run to build and install the package. Most users use an AUR helper (like a ‘package manager’ for AUR) to simplify the management of AUR packages: yay is one of the most popular AUR helpers. Check my post about yay for more info about how to install it and use it.

Other

Homebrew

Homebrew is a package manager for macOS and Linux with its own community-based repository to install software that can be missing or outdated in some operating systems. You don’t need superuser privileges to install Homebrew.

Check Homebrew webpage to know how to install it (it’s just a one-line command). After installation, you can use brew like any other package manager: brew install, brew update, brew uninstall,…

Snap/Flatpak

These package distribution systems also have their own repositories. Developers can create their own Flatpak repositories (aside the official one, flathub). There is only one Snap repository. You can find more info about Snap and Flatpak in their webpages or in my post.

If you have any suggestion, feel free to contact me via social media or email.