3

My sysadmin would like a proxy whitelist for some old CentOS sever I am trying to update (until now, it was cut off from the Internet).

I asked to have full Internet access, so I can just update everything, and install some more, and then send him the list of URLs that were needed for the update, so he can switch to a whitelist.

Unfortunately, the URLs used are not logged in /var/log/yum.log.

I came upon this question: How to know from which yum repository a package has been installed?

It tells me the "From repo", but this is just a "logical name" which can map to many URLs, and change over time, and "URL" is the "creator/source" of the package, not where it was physically downloaded from.

Is there somewhere else, where I can extract the URLs that yum used to install/update, or maybe can I configure the logging of yum to also log that information?

Currently, updating a package just produces something like this in the logs:

May 18 18:04:07 Updated: 1:busybox-1.15.1-21.el6_6.x86_64

monster
  • 608
  • 2
  • 10
  • 17

2 Answers2

4

The repo URLs are in the yum configuration files in the /etc/yum.repos.d directory.

Keep in mind that most CentOS repos use mirrorlists, which contain the URLs of every possible CentOS mirror, and any given package might have been downloaded from any mirror.

On EL 7 you can find the specific URL a package was downloaded from in the file /var/lib/yum/yumdb/[a-z]/[unique-id-packagename]/origin_url. This information will not be made available in EL 8.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
0

You can do yum info to see it, from yum installed for example.

Consider zlib on a Centos 6 box -

yum info zlib
Installed Packages
Name        : zlib
Arch        : i686
Version     : 1.2.3
Release     : 29.el6
Size        : 136 k
Repo        : installed
From repo   : base
Summary     : The zlib compression and decompression library
URL         : http://www.gzip.org/zlib/
License     : zlib and Boost
Description : Zlib is a general-purpose, patent-free, lossless data compression
            : library which is used by many different programs.

Name        : zlib
Arch        : x86_64
Version     : 1.2.3
Release     : 29.el6
Size        : 149 k
Repo        : installed
From repo   : anaconda-CentOS-201311272149.x86_64
Summary     : The zlib compression and decompression library
URL         : http://www.gzip.org/zlib/
License     : zlib and Boost
Description : Zlib is a general-purpose, patent-free, lossless data compression
            : library which is used by many different programs.

It shows From Repo for you.

MartyS
  • 109
  • 1
  • The only *URL* I see in there is "http://www.gzip.org/zlib/". It is not where the (compiled) package was downloaded from, rather where the source code comes from. This does not answer my question. – monster May 19 '17 at 11:16
  • You have to do more work and actually check the repo the package is listed from to get more information and therefore the URL. – MartyS May 23 '17 at 00:56