How To List The All Enabled Repositories In Linux?

How To List The All Enabled Repositories In Linux?


This post was last updated on August 1st, 2020 at 01:28 pm

A software repository is a database of software packages stored on a remote server. Generally, these packages are retrieved using a package manager in the local machine.

Linux comes preconfigured with some repositories that allow us to download and install the updates or packages officially released by that distribution. Sometimes you may need to download packages from a different source.

In this case, first, you will have to add that repository and then you can download or install the software. You can see how to add a repository in Linux. Ahead in this article, we will discuss to list the enabled or active repositories in a system.

Enabling a repository in Ubuntu

The package manager in Ubuntu and its derivatives gets the information of repositories from /etc/apt/sources.list or files listed in /etc/apt/sources.list.d. Enabling a repository means apt can download the packages from it. Now if you open the sources.list file in a text editor it will look something like this-

The #(hash symbol) at the beginning of the given software source means currently it is disabled. So if you want to enable it just remove that # sign and save this file.

Now if you look into the /etc/apt/sources.list.d directory you may find some other files. Execute the following command to list the files in this directory –

cd /etc/apt/sources.list.d


In Linux Mint, the official repositories are mentioned in the official-package-repositories.list. Look at the image below, It shows the content of this file –

Now if you want to know how to enable repositories in RPM-based distributions such as RHEL, CentOS or Fedora then you can read this.

List the enabled repositories in Debian, Ubuntu and Linux Mint

A debian based system uses apt or apt-get package manager. We can use this to list the enabled repositories in distributions such as Ubuntu, Linux Mint, etc. Now to list it just open your terminal by pressing ctrl+alt+t and then enter the following command –

apt-cache policy

When you use this command without any argument. It displays the priority of each source or repositories.

List the enabled repositories in CentOS, RHEL, Fedora

RPM-based distributions such as CentOS, RHEL, etc use yum(yellow dog updater modified) package manager. So, Yum is the tool used for installing, updating, and removing RPM packages. Execute the below command to display the list of enabled repositories –

In RHEL and CentOS –

yum repolist


yum repolist enabled

In Fedora –

Fedora Linux uses dnf(Dandified yum) which is a fork of yum package manager. From Fedora version 22 dnf is the default package manager. To display the list of enabled repositories use –

dnf repolist


dnf repolist enabled

That’s all for now. In this article, you have learned to enable the repositories and listing them in the terminal. If you have any questions related to this topic then write to us in the comments below.

Previous How To Open A Directory with Root Privileges In Ubuntu 20.04 LTS?
Next How To Set Password On A RAR Archive In Linux?

About author

You might also like

Linux Topics 3 Comments

How to Create a USB Bootable Ubuntu Live Disk

This post was last updated on November 3rd, 2020 at 05:35 pmLooking to make a Live Ubuntu USB disk? then you have arrived at the right place. Here I will

FreeBSD 0 Comments

How To Install And Configure Gnome Desktop in FreeBSD?

This post was last updated on August 1st, 2020 at 12:05 pmFreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution. It is used to power

How To 0 Comments

How To Extract A Zip File In Linux Using Terminal?

This post was last updated on August 1st, 2020 at 12:26 pmZip is an archive file format that supports lossless data compression. It is available for various platforms. Windows and


No Comments Yet!

You can be first to comment this post!

Leave a Reply