19

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
  • 27,358
  • 21
  • 74
  • 110

2 Answers2

16

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.

Jenny D
  • 27,358
  • 21
  • 74
  • 110
3
sudo yum -v clean expire-cache

didn't work for me. However, I was able to get it working with

sudo touch /etc/yum.repos.d/<your_repo_file>

and

yum repolist

shows it is updated. Hope this helps.

Z_K
  • 31
  • 2