大网数据广告活动
服务器运维问答

How to know from which yum repository *URL* a package has been installed?

· 52CE 我爱测

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,…

问题原文

原帖链接 · monster · CC BY-SA 3.0

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

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 4.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-05-18)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。