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
ls

 

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

or

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

or

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 0 Comments

How to Print files in Linux Using Command Line

Printing a file is one of the basic functionalities provide by the linux operating system, rather than just printing a file its provides us with a variety of options like

Linux Topics 0 Comments

How To Install PuTTY In Linux And Use It As An SSH Client?

This post was last updated on August 1st, 2020 at 10:12 pmEarlier I published how to connect to a Linux server using SSH using the command line. This article describes

How To 0 Comments

ISO, CDR, and CDRW in Linux

This post was last updated on May 27th, 2020 at 04:02 pmContents1 Creating an ISO Image2 Copying a CD to a File on your Filesystem3 Buring an ISO Image to

0 Comments

No Comments Yet!

You can be first to comment this post!

Leave a Reply