【问题标题】:Cache Yum downloads via squid proxy通过 squid 代理缓存 Yum 下载
【发布时间】:2013-08-03 04:10:05
【问题描述】:

我已安装 Squid 并配置 Yum 将其用作代理 - 这在获取 repo 数据时有效 - 我可以在 Squid 访问日志中看到它。

[root@box tmp]# yum check-update
Loaded plugins: rhnplugin, security
epel | 3.6 kB     00:00
epel/primary_db | 3.8 MB     00:00
rhel-x86_64-server-5 | 1.4 kB     00:00
rhel-x86_64-server-5/primary | 5.4 MB     00:01

[root@box~]# tail -f /var/log/squid/access.log
1375408719.219    915 10.0.0.22 TCP_MISS/200 643 GET http://mirrors.fedoraproject.org/mirrorlist? - DIRECT/66.35.62.166 text/plain
1375408719.514      0 10.0.0.22 TCP_MEM_HIT/200 4091 GET http://mirror.iprimus.com.au/epel/5/x86_64/repodata/repomd.xml - NONE/- text/xml
1375408719.893     45 10.0.0.22 TCP_HIT/200 3982344 GET http://mirror.iprimus.com.au/epel/5/x86_64/repodata/6964aae8cc07d55241680cec98f79908a810454e-primary.sqlite.bz2 - NONE/- application/x-bzip

但当我实际执行 yum 安装或更新软件包时,没有迹象表明这是通过代理进行的(它仍​​然有效,但我想缓存数据以便网络上的其他人可以使用它)

在我的 /etc/yum.conf 我有 proxy=http://domain.com:3128 并且我还设置了全局 $http_proxy 变量(wget http://www.google.com 成功使用了这个代理变量)

有什么想法吗?我猜 yum 没有使用 http 进行下载?

【问题讨论】:

标签: linux proxy yum squid rhel


【解决方案1】:

同意,这应该是服务器故障。

不过,在回答您的问题时: 您需要在 yum.repos.d/*.repo 中注释掉 mirrorlist= 并取消注释/编辑 baseurl= - yum 的旋转镜像会导致 squid 多次缓存包,因此您必须通过指定来解决此问题只有一面镜子。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-08-23
    • 1970-01-01
    • 2017-08-09
    • 2020-08-15
    相关资源
    最近更新 更多