How To List The All Enabled Repositories In Linux?

How To List The All Enabled Repositories In Linux?


This post was last updated on May 3rd, 2020 at 10:23 am

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 visit the following link to know 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. Here you learn the enabling repositories and listing them in the terminal. If you have any questions related to this topic then write to us in the comment section.

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

Uncategorized 0 Comments

How To List All The Users In A Linux Or Unix System?

Linux is a multi-user operating system. It means more than one user can use system resources simultaneously. To use the system resources a user must have a user account on

Uncategorized 0 Comments

How To Install PyCharm In Linux Mint?

The PyCharm is a fully-featured IDE for python. It is developed by JetBrains. PyCharm supports many other programming languages such as HTML, CSS, Javascript, SQL, etc. The features of PyCharm

Uncategorized 0 Comments

How To Count Words, Lines, of A File with wc command In Linux/Unix?

While working with files especially with text files sometimes you may need to count the number of words, number of lines, total character, etc. Linux/Unix provides wc command which is


No Comments Yet!

You can be first to comment this post!

Leave a Reply