Home Package management How To Find The List Of Installed Repositories From Commandline In Linux

How To Find The List Of Installed Repositories From Commandline In Linux

By sk
16037 Views

This brief tutorial explains how to find the list of installed repositories in Linux from command line. Listing the installed repositories from CLI mode is not only easier, but also faster compared to GUI mode. Here, I have given methods to list installed repositories in various Linux distributions.

1. Find the list of installed repositories in Linux

We can find the list of all enabled and configured repositories using the distribution's default package manager or using a third-party tool named inix.

First, we will see how to list installed or enabled repositories using the package manager.

1.1. List installed repositories in Fedora, RHEL, AlmaLinux, Rocky Linux

To view the list of installed repositories in RPM based systems such as Fedora, RHEL and its clones like CentOS, AlmaLinux, Rocky Linux, run the following command:

$ dnf repolist

Sample output from Fedora 34:

repo id repo name
fedora Fedora 34 - x86_64
fedora-cisco-openh264 Fedora 34 openh264 (From Cisco) - x86_64
fedora-modular Fedora Modular 34 - x86_64
rpmfusion-free RPM Fusion for Fedora 34 - Free
rpmfusion-free-updates RPM Fusion for Fedora 34 - Free - Updates
rpmfusion-nonfree RPM Fusion for Fedora 34 - Nonfree
rpmfusion-nonfree-updates RPM Fusion for Fedora 34 - Nonfree - Updates
updates Fedora 34 - x86_64 - Updates
updates-modular Fedora Modular 34 - x86_64 - Updates
List installed repositories in Fedora, RHEL
List installed repositories in Fedora, RHEL

In older RHEL versions, you can use yum instead of dnf to get the list of installed repositories:

$ sudo yum repolist

Sample output from CentOS 7:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fibergrid.in
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.fibergrid.in
 * updates: mirror.fibergrid.in
repo id repo name status
!base/7/x86_64 CentOS-7 - Base 9,363
!docker-main-repo Docker main Repository 110
!epel/x86_64 Extra Packages for Enterprise Linux 7 - x86_64 11,722
!extras/7/x86_64 CentOS-7 - Extras 380
!updates/7/x86_64 CentOS-7 - Updates 1,838
repolist: 23,413

Or, use the following command:

$ sudo yum repolist all

Output from CentOS 7 server edition:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.fibergrid.in
 * epel: ftp.cuhk.edu.hk
 * extras: mirror.fibergrid.in
 * updates: mirror.fibergrid.in
repo id repo name status
C7.0.1406-base/x86_64 CentOS-7.0.1406 - Base disabled
C7.0.1406-centosplus/x86_64 CentOS-7.0.1406 - CentOSPlus disabled
C7.0.1406-extras/x86_64 CentOS-7.0.1406 - Extras disabled
C7.0.1406-fasttrack/x86_64 CentOS-7.0.1406 - CentOSPlus disabled
C7.0.1406-updates/x86_64 CentOS-7.0.1406 - Updates disabled
C7.1.1503-base/x86_64 CentOS-7.1.1503 - Base disabled
C7.1.1503-centosplus/x86_64 CentOS-7.1.1503 - CentOSPlus disabled
C7.1.1503-extras/x86_64 CentOS-7.1.1503 - Extras disabled
C7.1.1503-fasttrack/x86_64 CentOS-7.1.1503 - CentOSPlus disabled
C7.1.1503-updates/x86_64 CentOS-7.1.1503 - Updates disabled
C7.2.1511-base/x86_64 CentOS-7.2.1511 - Base disabled
C7.2.1511-centosplus/x86_64 CentOS-7.2.1511 - CentOSPlus disabled
C7.2.1511-extras/x86_64 CentOS-7.2.1511 - Extras disabled
C7.2.1511-fasttrack/x86_64 CentOS-7.2.1511 - CentOSPlus disabled
C7.2.1511-updates/x86_64 CentOS-7.2.1511 - Updates disabled
!base/7/x86_64 CentOS-7 - Base enabled: 9,363
base-debuginfo/x86_64 CentOS-7 - Debuginfo disabled
base-source/7 CentOS-7 - Base Sources disabled
c7-media CentOS-7 - Media disabled
centosplus/7/x86_64 CentOS-7 - Plus disabled
centosplus-source/7 CentOS-7 - Plus Sources disabled
cr/7/x86_64 CentOS-7 - cr disabled
!docker-main-repo Docker main Repository enabled: 110
!epel/x86_64 Extra Packages for Enterprise Linu enabled: 11,722
epel-debuginfo/x86_64 Extra Packages for Enterprise Linu disabled
epel-source/x86_64 Extra Packages for Enterprise Linu disabled
epel-testing/x86_64 Extra Packages for Enterprise Linu disabled
epel-testing-debuginfo/x86_64 Extra Packages for Enterprise Linu disabled
epel-testing-source/x86_64 Extra Packages for Enterprise Linu disabled
!extras/7/x86_64 CentOS-7 - Extras enabled: 380
extras-source/7 CentOS-7 - Extras Sources disabled
fasttrack/7/x86_64 CentOS-7 - fasttrack disabled
!updates/7/x86_64 CentOS-7 - Updates enabled: 1,838
updates-source/7 CentOS-7 - Updates Sources disabled
repolist: 23,413

The above command will list all repositories i.e. both enabled and disabled repositories.

To list only enabled repos, run the following command:

$ dnf repolist enabled

Or,

$ yum repolist enabled

To list only disabled repos, enter:

$ dnf repolist disabled

Or,

$ yum repolist disabled

1.2. List installed repositories in Debian, Ubuntu

Run the following command to view the list of installed packages in DEB based systems like Debian, Ubuntu, Linux Mint, Pop!_OS etc.

$ sudo apt-cache policy

Sample output:

Package files:
 100 /var/lib/dpkg/status
 release a=now
 500 http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2/multiverse amd64 Packages
 release o=mongodb,a=trusty,n=trusty/mongodb-org,l=mongodb,c=multiverse,b=amd64
 origin repo.mongodb.org
 500 http://ppa.launchpad.net/linrunner/tlp/ubuntu xenial/main i386 Packages
 release v=16.04,o=LP-PPA-linrunner-tlp,a=xenial,n=xenial,l=TLP,c=main,b=i386
 origin ppa.launchpad.net
 500 http://ppa.launchpad.net/linrunner/tlp/ubuntu xenial/main amd64 Packages
 release v=16.04,o=LP-PPA-linrunner-tlp,a=xenial,n=xenial,l=TLP,c=main,b=amd64
 origin ppa.launchpad.net
 .
 .
 .
 .
 500 http://in.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
 release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=universe,b=amd64
 origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu xenial/restricted i386 Packages
 release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=restricted,b=i386
 origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu xenial/restricted amd64 Packages
 release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=restricted,b=amd64
 origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu xenial/main i386 Packages
 release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=i386
 origin in.archive.ubuntu.com
 500 http://in.archive.ubuntu.com/ubuntu xenial/main amd64 Packages
 release v=16.04,o=Ubuntu,a=xenial,n=xenial,l=Ubuntu,c=main,b=amd64
 origin in.archive.ubuntu.com
Pinned packages:

Or, use this command to find the installed repositories in your DEB based system.

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

Here is the output from my Ubuntu 16.04 LTS server.

deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://in.archive.ubuntu.com/ubuntu/ xenial universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse
deb http://archive.ubuntu.com/ubuntu xenial universe
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse
deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu xenial main
deb http://ppa.launchpad.net/linrunner/tlp/ubuntu xenial main
deb http://in.archive.ubuntu.com/ubuntu/ xenial main restricted
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
deb http://in.archive.ubuntu.com/ubuntu/ xenial universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
deb http://in.archive.ubuntu.com/ubuntu/ xenial multiverse
deb http://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
deb http://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu xenial-security main restricted
deb http://security.ubuntu.com/ubuntu xenial-security universe
deb http://security.ubuntu.com/ubuntu xenial-security multiverse

1.3. List installed repositories in SUSE/openSUSE

To view the list of repositories in SUSE/openSUSE, run:

$ zypper lr

Or,

$ zypper repos

Sample output from my openSUSE desktop:

[email protected]:~> zypper lr
# | Alias | Name | Enabled | GPG Check | Refresh
--+---------------------+------------------------------+---------+-----------+--------
1 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes 
2 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes 
3 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes 
4 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Yes 
[email protected]:~> zypper repos
# | Alias | Name | Enabled | GPG Check | Refresh
--+---------------------+------------------------------+---------+-----------+--------
1 | repo-non-oss | openSUSE-leap/42.1-Non-Oss | Yes | (r ) Yes | Yes 
2 | repo-oss | openSUSE-leap/42.1-Oss | Yes | (r ) Yes | Yes 
3 | repo-update | openSUSE-42.1-Update | Yes | (r ) Yes | Yes 
4 | repo-update-non-oss | openSUSE-42.1-Update-Non-Oss | Yes | (r ) Yes | Ye

1.4. List installed repositories in Arch Linux, EndeavourOS, Manjaro Linux

As far as I know, Pacman doesn't has any direct command to list installed repositories in Arch Linux. We can, however, use the command that is used to sync official repositories to find the list of enabled repositories in Arch Linux.

$ sudo pacman -Syy

Sample output:

:: Synchronizing package databases…
  core                  135.0 KiB   169 KiB/s 00:01 [######################] 100%
  extra                1562.7 KiB   505 KiB/s 00:03 [######################] 100%
  community               5.6 MiB   977 KiB/s 00:06 [######################] 100%

1.5. List installed repositories in Alpine Linux

In Alpine Linux, all repositories are configured in /etc/apk/repositories file. To view the configured repositories, just take a look at the contents of this file using cat command:

$ cat /etc/apk/repositories

Sample output:

https://sjc.edge.kernel.org/alpine/edge/main
https://sjc.edge.kernel.org/alpine/edge/community

2. List installed repositories in Linux using inxi utility

An another easy way to display the list of repositories is using inxi utility. It will work on most Linux operating systems that supports Inxi.

Inxi is a free, open source, and full featured command line system information tool. It shows various useful system details, including CPU, drivers, Xorg, Desktop, Kernel, GCC version(s), Processes, RAM usage, and more. It currently supports the following package managers.

  • APT (Debian, Ubuntu, and derivatives)
  • PACMAN (Arch Linux, and derivatives)
  • PISI (Pardus, and derivatives)
  • PORTAGE (Gentoo, Sabayon, and derivatives)
  • PORTS (OpenBSD, FreeBSD, NetBSD, and derivatives)
  • SLACKPKG (Slackware, and derivatives)
  • URPMQ (Mandriva, Mageia, and derivatives)
  • YUM/ZYPP (Fedora, Redhat, Suse, and derivatives)

Refer the following guide to know more about inxi tool.

To list the installed repositories in Linux using inxi, run:

$ inxi -r

Sample output from my Arch Linux system:

Repos: 
 Active pacman repo servers in file: /etc/pacman.d/mirrorlist
 http://mirror.hactar.xyz/$repo/os/$arch
 http://archlinux.mirrors.uk2.net/$repo/os/$arch
 http://mirrors.dotsrc.org/archlinux/$repo/os/$arch
 http://ftp.acc.umu.se/mirror/archlinux/$repo/os/$arch
 http://fooo.biz/archlinux/$repo/os/$arch
 http://mirror.csclub.uwaterloo.ca/archlinux/$repo/os/$arch
 http://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch
 http://ftp.sh.cvut.cz/arch/$repo/os/$arch
 http://mirror.js-webcoding.de/pub/archlinux/$repo/os/$arch
 http://mirror.frgl.pw/archlinux/$repo/os/$arch
 http://mirror.internode.on.net/pub/archlinux/$repo/os/$arch
 http://ftp.myrveln.se/pub/linux/archlinux/$repo/os/$arch
 http://mirrors.uni-plovdiv.net/archlinux/$repo/os/$arch
 http://mirror.archlinux.no/$repo/os/$arch
 http://ftp.yzu.edu.tw/Linux/archlinux/$repo/os/$arch
 http://mirror.armbrust.me/archlinux/$repo/os/$arch
 http://mirror.tyborek.pl/arch/$repo/os/$arch
 http://mirror.f4st.host/archlinux/$repo/os/$arch
 http://ftp.nluug.nl/os/Linux/distr/archlinux/$repo/os/$arch
 http://mirror.neuf.no/archlinux/$repo/os/$arch
 Active pacman repo servers in file: /etc/pacman.conf
 http://repo.archlinux.fr/$arch

Conclusion

In this guide, we have discussed two ways to list Linux repositories from commandline. We saw how to list enabled repositories in Linux using the package manager and also using an external tool called inix.

Hope this helps.

You May Also Like

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More