Centos – Install Fedora Source package on RHEL / CentOS

centoscurlredhatrpm

I'm attempting to upgrade curl on RHEL / CentOS machines. I've found what seems to be the appropriate source packages in a number of repos. (ie, http://mirror.centos.org/centos/6/os/SRPMS/Packages/curl-7.19.7-16.el6.src.rpm)

When attempting to make an rpm from the source package using rpmbuild, I get the following output;

# rpmbuild --rebuild curl-7.19.7-16.el6.src.rpm
Installing curl-7.19.7-16.el6.src.rpm
warning: InstallSourcePackage: Header V3 RSA/SHA256 signature: NOKEY, key ID c105b9de
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root
error: unpacking of archive failed on file /usr/src/redhat/SOURCES/curl-7.15.3-multilib.patch;4e984633: cpio: MD5 sum mismatch
error: curl-7.19.7-16.el6.src.rpm cannot be installed

The issue seems to be that the source is meant for Fedora, which uses SHA-256. There's a bug filed here that has comments indicating there's a means to circumvent the md5 checksum. However, it's not very detailed.

Is there a way to install this package?

Best Answer

I assume you want to upgrade CentOS5 curl to a version from CentOS6. I think the problem is not with SHA256 signature but with XZ/LZMA compression which is not supported by CentOS5.

You'd need to:

  • run CentOS6 on a spare computer or virtual machine — LiveCD is enough
  • on CentOS6: yum install rpm-build yum-utils
  • on CentOS6: yumdownloader --source curl
  • on CentOS6: rpm -i curl-*.src.rpm
  • on CentOS6: scp -pr ~/rpmbuild your_username@your_centos_ip:
  • on CentOS5: rpmbuild -ba ~/rpmbuild/SPECS/curl.spec