How to List Installed Repositories In Ubuntu & Debian

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 xenial main restricted
deb-src xenial main restricted
deb xenial-updates main restricted
deb-src xenial-updates main restricted
deb xenial universe
deb-src xenial universe
deb xenial-security universe
deb-src xenial-security universe
deb xenial-security multiverse
deb-src 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.

Let’s try below command:

sudo apt-cache policy 


Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 xenial/main amd64 Packages
     release v=16.04,o=LP-PPA-ondrej-php,a=xenial,n=xenial,l=***** The main PPA for supported PHP versions with many PECL extensions *****,c=main,b=amd64
 500 xenial/main amd64 Packages
     release o=Node Source,n=xenial,l=Node Source,c=main,b=amd64
 500 xenial/main amd64 Packages
     release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=amd64
Pinned packages:


In this tutorial, you have learned to find all the repositories configured on Ubuntu or Debian based system.

The post How to List Installed Repositories In Ubuntu & Debian appeared first on TecAdmin.

Leave a Comment

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