Determining Yum repo URL

20,702

Use the verbose flag with yum repolist -v enabled

$ yum repolist -v enabled
Repo-id      : epel
Repo-name    : Extra Packages for Enterprise Linux 6 - x86_64
Repo-revision: 1565313214
Repo-updated : Thu Aug  8 19:14:15 2019
Repo-pkgs    : 12,559
Repo-size    : 11 G
Repo-metalink: https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64
  Updated    : Thu Aug  8 19:14:15 2019
Repo-baseurl : https://sjc.edge.kernel.org/fedora-buffet/epel/6/x86_64/ (50
             : more)
Repo-expire  : 21,600 second(s) (last: Sat Aug 10 10:54:19 2019)

If you want to get only the URLs,

$ yum repolist -v enabled | grep Repo-baseurl | cut -d\  -f 3
http://mirror/pe-repos/6.x86_64
http://mirror/uimrepo
https://sjc.edge.kernel.org/fedora-buffet/epel/6/x86_64/
http://mirror/openclrepo
https://puppet.contoso.com:8140/packages/2016.4.11/el-6-x86_64
http://mirror/rhel6.5.extra.x86_64
http://mirror/rhel6.5.x86_64
http://mirror/rhel6.5.patch-current.x86_64

Or just grep the repo files directly

$  grep 'baseurl=' /etc/yum.repos.d/* | cut -d= -f2
http://download.fedoraproject.org/pub/epel/6/$basearch
http://download.fedoraproject.org/pub/epel/6/$basearch/debug
http://download.fedoraproject.org/pub/epel/6/SRPMS
http://download.fedoraproject.org/pub/epel/testing/6/$basearch
http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug
http://download.fedoraproject.org/pub/epel/testing/6/SRPMS
http://mirror/openclrepo
https://puppet.contose.com:8140/packages/2016.4.11/el-6-x86_64
http://mirror/pe-repos/6.x86_64
ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
http://mirror/uimrepo
http://mirror/rhel6.5.x86_64
http://mirror/rhel6.5.extra.x86_64
http://mirror/rhel6.5.patch-current.x86_64
Share:
20,702

Related videos on Youtube

Bala
Author by

Bala

Updated on September 18, 2022

Comments

  • Bala
    Bala over 1 year

    If I add a new repo file under /etc/yum.repo.d/ folder. How can I gather all the URL which yum update will go out to fetch updates.

    I am asking this because I have a server behind a firewall, which will allow traffic only to predesignated domain names. I want to determine all the domain names so that I can whitelist them all, so that my server remains updated.

    enter image description here