Managing Repositories with the Terminal

Use the apt-manage tool to add and remove apt repositories in the /etc/apt/sources.list.d/ directory. Use the flatpak tool to add and remove Flatpak repositories from the ~/.local/share/flatpak/repo/ directory.

Using the apt-manage Command

The apt-manage command is unique to Pop!_OS and comes from repolib, the same library that Repoman is built upon. All options for the apt-manage command can be viewed by opening a Terminal and entering:

apt-manage -h

Add a Repository Using apt-manage

The add option will create an entry in the text file located in /etc/apt/sources.list.d/. Enter this command and enter your password when prompted.

apt-manage add [RepositoryURI]

In this example, the apt repository for the ProtonVPN CLI tool is added:

Add Repo with apt-manage

Confirm the repository has been added using the list option:

apt-manage list

apt-manage View Added Repo

Remove a Repository Using apt-manage

While sources can be added using the URI, they must be removed using the repository's source name.

Use the list option to obtain the source name of the repo you wish to remove:

apt-manage list

Find Repo Source Name

Use the remove option to remove the source:

apt-manage remove [SourceName]

Press y to confirm you want to remove the source and enter your password when prompted.

apt-manage Confirm Removal

Confirm the repository has been removed using the list option:

apt-manage list

apt-manage List Repos

Using the flatpak Command

Flatpak repositories can be added and removed using options available with the flatpak command. See all available options for the flatpak command by opening the Terminal and entering:

flatpak -h

Adding a Repository with the flatpak Command

Use the remote-add and user options to add a remote Flatpak repository for the current user.

flatpak remote-add --user [repo-name] [repo-url]

Add Repo with Flatpak Tool

Use the remote-list option to confirm the repository has been added:

flatpak remote-list

View Added Flatpak Repo Command

Removing a Repository with the flatpak Command

Use the remote-delete command to remove a repository. Specify the name of the repository in this command. Use the remote-list option to confirm the repository's name if you aren't sure.

flatpak remote-delete [repository name]

Remove Repo with Flatpak Tool

Use the remote-list option to confirm the repository has been deleted:

flatpak remote-list

View Deleted Flatpak Repo Command