yum does not pick the latest package

Solution 1:

First off, did you run createrepo on your yum repository? You'll need to rebuild the metadata whenever you add new packages.

Secondly, what's the timeout on the cache? You can forecfully clean your localized metadata on your client by running yum clean all, then try checking for updates again. It will download all updated metadata from the repositories.

Hope this helps!

Solution 2:

I was having same issue. I did 'yum clean all' on rpm client. I ran 'createrepo' on Yum Repo server. Nothing worked.

Finally I was able to fix this by adding following line in /etc/yum.conf on Yum clients:

metadata_expire=1m

After I added the line on Yum clients, yum command picked up new rpm on local Yum repo without any problem.

Following command shows you more info:

man yum.conf

FYI. CentOS 5 has the parameter commented out. CentOS 6.2 has 90m for the value.

Solution 3:

Assuming you ran the createrepo command after dropping the new RPM in there, try yum clean expire-cache and it should pick it up.