10

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

1
  • I am still behind this without any headway, Is there any easy method to figuring this out rather than sticking a proxy up in front and gathering all the domains ?
    – Bala
    Commented Feb 22, 2017 at 11:10

2 Answers 2

13

Use the verbose flag (--verbose/-v) 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
0

You can grep the URL's used by yum from the /etc/yum.repo.d/* files.

Meanwhile, yum will download lists of URL's and attempt to use the fastest URL for downloading. Those lists can/will change, so you will have to configure the URL's you wish to use.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .