Ubuntu – Yum repo lists incorrect size for packages larger than 2GB

centosUbuntuyum

I'm using createrepo to create my yum repository. However, it seems to have a bug – one of my packages, which is 11GB in size, is incorrectly shown as just 956 MB when I try to do a yum install bigpackage from a client machine.
When trying to download the big package for installation, yum errors out with this:

Error Downloading Packages:
  bigpackage-0.1-53952.x86_64: failed to retrieve bigpackage-0.1-53952.x86_64.rpm from myrepo-prod-source
error was [Errno 14] Downloaded more than max size for http://myrepo/yum/repo/centos//bigpackage-0.1-53952.x86_64.rpm: 1073004544 > 975454259

This is obviously because the package is listed in my repo with the wrong size. So I googled around for a solution.

This appears to be a bug with createrepo. It is incorrectly casting some 64bit integers internally and the variable used to store the size of the package is getting corrupted. Here are pages I've uncovered in my search for resolution of this issue:

A patch that purportedly fixes this issue:

http://yum.baseurl.org/gitweb?p=yum-metadata-parser.git;a=commitdiff;h=2d8499cf272bf9027d015fae0d344998debfae69

I'm not sure how to apply that patch, but in the hopes that the latest version of createrepo includes that fix, I downloaded and upgraded to the latest dev version of createrepo, 0.9.8.

This still didn't work, however – the size of the big package is still listed incorrectly. Argh! Any ideas on how to fix createrepo to show the right size in the repo? Any alternative tools for creating yum repos that support packages larger than 2GB?

Best Answer

As it turns out, the patch I found is not for CreateRepo and has nothing to do with Ubuntu, it is in fact for yum-metadata-parser (on CentOS, this package is called yum-metadata-parser.x86_64 1.1.2-16.el6). It's trying to parse the large size number that is correctly written within the repository xml file and fails because it's not a 64 bit integer column in the sqlite db that yum uses.

Applying the patch to the yum-metadata-parser source, building it, and installing it worked!