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

yum client doesn't see new packages though server is updated

· 52CE 我爱测

We have an internal yum server containing several repos (copies of the RHEL repo, programs created in-house, and so on). Our internal systems are firewalled off from the internet, so they can only use our internal server. In orde…

问题原文

原帖链接 · Jenny D · CC BY-SA 3.0

We have an internal yum server containing several repos (copies of the RHEL repo, programs created in-house, and so on). Our internal systems are firewalled off from the internet, so they can only use our internal server.

In order to test patches out before pushing them all the way into production, we have a stable repo that is enabled by default. Any updates get put in the -latest repo. When we patch servers, we'll use that -latest-repo to build a new baseline and test it out on a few servers. Once tested, we make that baseline the new stable. The -latest repos are disabled by default.

One of the repos is used for a few packages that we fetch from epel, rpmforge and so on. We have a script that syncs down only the packages we want with any dependencies they need. The repo is rebuilt nightly with createrepo after the packages are synced. Since these packages are untested, they end up in the int-optional-latest repo which is usually disabled. If a server needs a package from that repo, we'll install it using enable-repo=int-optional-latest.

Today a coworker was trying to install perl-Excel-Writer-XLSX on a server. The server didn't find the package. I tried rebuilding the repository using createrepo, and grepped the repodata files to make sure the file was there. It was. I also verified that the file existed within the repository using

repoquery -q --repoid=int-optional-latest -l perl-Excel-Writer-XLSX

I also cleared out the metadata cache on the client side, using

sudo yum clean expire-cache

Despite this, the client kept claiming that the package didn't exist on the server.

I don't think the problem is on the server side, because when I tried doing a search from another machine, it found the package. I verified that the repo files were correct and that the name yum.example.com resolved to the same IP address on both servers - yet one of them can find the package, and the other one can't.

已采纳解答

原帖链接 · Jenny D · CC BY-SA 3.0

I started digging into the webserver logs on the yum server, and didn't find any hits from the IP for the client that couldn't find the files. I didn't understand this at first, since I'd cleared out the cache on the clients. So I did another cache cleanout, this time using

sudo yum -v clean expire-cache

When run with -v, it lists which repos it cleans - and the int-optional-latest wasn't in the list. I figure this was due to the repo being disabled by default. I did another cache-clearing, this time using

sudo yum -v enable-repo=int-optional-latest clean expire-cache

After that, I tried another

sudo yum enable-repo=int-optional-latest install perl-Excel-Writer-XLSX

which worked perfectly.

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

资料来源与适用范围

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

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

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