How to debug yum search since it doesn't show me correct info ?

Latest response

Hello,

I have two different RH server (5.2 and 5.9). and created our local package repository (for now with just one package in it called 'splunkforwarder'):

# cat /etc/yum.repos.d/netsec.repo
[netsec]
name=repo for netsec team
baseurl=http://local.server/repos/netsec
enabled=1
gpgcheck=0
 

(this file is created on both servers).

But one server doesn't see any package in this repository:

# yum repolist|grep netsec
netsec              repo for netsec team                               1
 

And on the other I get:

# yum repolist|grep netsec
netsec            repo for netsec team                  enabled

Why the second server just shows me "enabled" (and it can't find any package) and the other can find needed package ?

Responses

I have just noticed that on RH 5.2 yum displays by default "enabled" instead number of packages in each repository. But even I run "yum search splunk" it doesn't show my anything on one host and shows me splunk package on the other. Can anyone shed some light what is going on ?

Usually, when a yum client can see a repo but not the contents of that repo, it means one of two things: you don't have the repo metadata properly created; you don't have permissions set appropriately on your repo files. Can't tell from your repo definition as to whether "local.server" is supposed to mean "some server on the local network" or if you actually mean to reference a location on the same system that the yum-client is running on (in which case, you're probably better using "file://" than "http://").

Any way, need more info on what steps you used to create your repos: how did you put the files in place, what utilities did you use to create your repo data-structures, what method are you using to publish your repo, etc. If the contents should be the identical, then I'd probably:

  1. Set up one repo, get it working (normally, I'd suggest Satellite or SpaceWalk, but it looks like you're only trying to host one file and those two options would be massive overkill).
  2. Use rsync to duplicate the repo from one server to another (rsync might be a bit more overhead than you really want, but it's pretty good for ensuring that not only are your files duped, but so are all the attributes that made them sharable from the original system).
  3. If things didn't work as expected on the second server, re-generate the repo data-structures, verify my file/directory permissions, etc and see if that fixes things.

Hi Tom,

thanks for feedback. :-)

The repo is on another server in our local LAN. The repo definition file (in /etc/yum.repos.d) on both servers is the same.

But what confuses me is that on one server "yum search splunk" says that there is a file in this repo. But on the other "yum search splunk" says that it doesn't exists :-(

UPDATE:

To sum up: there is just one repository on the LAN which is being used by two different servers: one correctly shows a package from the repository, one doesn't ...

Does your network access control policy permit HTTP from both servers to the repository? Is it possible that one of the two servers is located on a different VLAN, and its network access is being filtered? (You might want to check iptables on both the not working host and the repo, as well.)

Yes, both servers can access the repo server without any problems. I can even see logs in http logs.

I found where the problem is: the server with "issues" is i386 architecture and in the repo I have a package for x64 architecture.

Solution found :-)

Great! Glad you got this resolved. And thanks for letting us know what did the trick.