Debian

How to List Installed Repositories in Debian

In a Linux system, including Debian, the default system repository already includes a large collection of packages, which you can install from the apt command. However, some packages require adding an external PPA repository so that you can install the latest version of packages onto the system. Adding too many unused repositories into the system may result in reducing the update process or it may cause errors while installing a package update. For this purpose, you must require viewing the repositories list on your system so that you can remove the erroneous repository from the system.

This article provides several useful methods to list the installed repositories in Debian.

How to List Installed Repositories in Ubuntu & Debian

You can list the installed repositories in Debian:

Method 1: List Installed Repositories Using Terminal

There are several terminal commands that list the installed repositories in Debian.

Command 1

The first one on the list is the grep command that can be utilized to list the installed repositories in Debian. It takes the repository information from the “sources.list” location:

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

Command 2

To get a detailed overview of installed repositories in Debian, use the following apt-cache command in the terminal:

sudo apt-cache policy

Command 3

The following apt command will also display all the installed or added repositories on your system:

apt policy

Command 4

You can also use the cat command to list installed repositories in Debian from the /etc/apt/sources.list location.

cat /etc/apt/sources.list

Method 2: List Installed Repositories in Debian via GUI

The other easiest and most straightforward way of displaying the repositories in Debian is through GUI. For this purpose, open the Software & Update option from the application menu.

Click on the Other Software tab and the list of installed repositories will be displayed on your screen.

Conclusion

Listing installed repositories in Debian can be done via terminal and GUI. The terminal method includes four different commands to list the installed repositories. While for the GUI method, you have to open the “Software and Update” option from the application menu to view the list of installed repositories in Debian.

About the author

Zainab Rehman

I'm an author by profession. My interest in the internet world motivates me to write for Linux Hint and I'm here to share my knowledge with others.