A repository is the collection of packages for a Linux operating system. You can create a central repository containing the actual packages. Then configure your other systems to connect with the main repository. From where, you can install, update packages.

The Ubuntu and other Debian based systems uses APT (Advanced Packages Tool) as package manager. Apt keeps all the configuration files under /etc/apt directory.

This tutorial will help you to list all installed repositories under a Ubuntu or Debian based system via command line.

List Installed Repositories In Ubuntu

The remote repository references are configured in /etc/apt/sources.list file and all files under /etc/apt/sources.list.d/ directory.

Use the following command to list all the configured repositories on apt based system:

sudo grep -rhE ^deb /etc/apt/sources.list* 

You will see the output like below:

deb http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial main restricted
deb http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial-updates main restricted
deb http://mirrors.digitalocean.com/ubuntu/ xenial universe
deb-src http://mirrors.digitalocean.com/ubuntu/ xenial universe
.
.
.
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb-src http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse

Alternatively, you can use apt-cache command to list all repositories. This command will provide also provide more details about the repository.

#debian #apt #debian #repository #ubuntu

How to List Installed Repositories In Ubuntu & Debian
1.55 GEEK