120

In CentOS how can I get a list of installed repositories?

Real Dreams
  • 5,408

4 Answers4

183
yum repolist
yum repolist enabled

shows all enabled repositories. Those two commands are identical.

yum repolist disabled

shows disabled repositories.

yum repolist all

shows everything.

yum repolist --verbose

shows detailed information, including the URL.

Elijah Lynn
  • 1,602
19

This is the path of yum repository

[root@localhost yum.repos.d]# pwd

/etc/yum.repos.d

This is the content of that directory

[root@localhost yum.repos.d]# ll
total 60
-rw-r--r-- 1 root root  179 Jul 17 11:56 adobe-linux-i386.repo
-rw-r--r-- 1 root root 1926 Jun 26 14:59 CentOS-Base.repo
-rw-r--r-- 1 root root  637 Jun 26 14:59 CentOS-Debuginfo.repo
-rw-r--r-- 1 root root  626 Jun 26 14:59 CentOS-Media.repo
-rw-r--r-- 1 root root 2593 Jun 26 14:59 CentOS-Vault.repo
-rw-r--r-- 1 root root  912 Jan 23  2011 elrepo.repo
-rw-r--r-- 1 root root  957 May  9 21:25 epel.repo
-rw-r--r-- 1 root root 1056 May  9 21:25 epel-testing.repo
.
.
.

The difference between yum.conf and yum.repos.d is in earliar system yum.conf (/etc/yum.conf) was using, within a single file we have to configure everything it was very congesting so now what they did is, they created several repo files, instead of one repo file and all the repos are kept under /etc/yum.repos.d/ directory.

max
  • 4,163
8

This Page indicates that yum keeps individual repository settings in the [repository] sections in /etc/yum.conf and .repo files in the /etc/yum.repos.d/ directory. You should be able to see all the repositories from these two places. The link is about Redhat so YMMV.

From this link (also red hat), yum-config-manager repository might (or might not) achieve the same as above.

Karthik T
  • 2,784
7

I would like to add:

yum -v repolist all

in case the server is using Spacewalk or part of RedHat this can be very useful to find the Repository URL.

NOTE: If the server is registered to Spacewalk there will be no entries under /etc/yum.repos.d/ At least using the command to register like :

rhnreg_ks --activationkey=<key> --serverUrl=http://<server>/XMLRPC
Gryu
  • 280