Determining Yum repo URL

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

2 Answers

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: Updated : Thu Aug 8 19:14:15 2019
Repo-baseurl : (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

Or just grep the repo files directly

$ grep 'baseurl=' /etc/yum.repos.d/* | cut -d= -f2
ftp://
ftp://

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like