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:
Confirm the repository has been added using the list
option:
apt-manage list
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
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.
Confirm the repository has been removed using the list
option:
apt-manage list
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]
Use the remote-list
option to confirm the repository has been added:
flatpak remote-list
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]
Use the remote-list
option to confirm the repository has been deleted:
flatpak remote-list