Update: On December 10 2015 RedHat released a version of createrepo for RHEL 7 which has a fix for this issue: "0.9 .9-24 - mergerepo: merge package versions from multiple repos. - Related: bug#1178763"
They also released a version for RHEL 6 shortly after that fixes the issue: "0.9.9-23 - mergerepo: merge package versions from multiple repos. - Resolves: bug#1175925"
The "mergerepo" command in createrepo-0.10.1 and earlier eliminates duplicates at the artifact level. This has the effect of removing all but the latest version of an artifact in the generated metadata. This behavior has been fixed in newer versions of createrepo:
As of this writing (December 9, 2014) neither CentOS/RHEL 6 or CentOS/RHEL 7 has the fix for this.
The good news is that it is just a one line change:
--- a/createrepo/merge.py +++ b/createrepo/merge.py @@ -70,7 +70,7 @@ class RepoMergeBase: for repo in repos: for pkg in repo.sack: - others = self.yumbase.pkgSack.searchNevra(name=pkg.name, arch=pkg.arch) + others = self.yumbase.pkgSack.searchNevra(pkg.name, pkg.epoch, pkg.version, pkg.release, pkg.arch) # NOTE the above is definitely going to catch other versions which may # be an invalid comparison if len(others) > 1:
So it is easy for you to patch your system to fix this problem.
Alternatively, you can download the latest createrepo here:
And install that on your path in front of your current createrepo/mergerepo executable.