Monday 4 March 2013

rpm error: Failed dependencies: rpmlib(FileDigests) <=4.6.0-1 ,rpmlib(PayloadIsXz) <= 5.2-1

I created a package called testpackage-SVNTRRev94-0044.el6.x86_64.rpm in my build machine and installed in my build machine to test it
[root@testsys1 x86_64]# rpm -ivh testpackage-SVNTRRev94-0044.el6.x86_64.rpm
  Preparing... ########################################### [100%]
  1:testpackage ########################################### [100%]

The installation went fine and the required files were placed in the appropriate directory as mentioned in the SPEC file.

Now i need to install the same package in the QA machine for the team to validate it,  but i couldn't install the package due to the below error,
[root@qasys1 x86_64]# rpm -ivh testpackage-SVNTRRev94-0044.el6.x86_64.rpm
error: Failed dependencies:
rpmlib(FileDigests) <= 4.6.0-1 is needed by testpackage-SVNTRRev94-0044.el6.x86_64.rpm
rpmlib(PayloadIsXz) <= 5.2-1 is needed by testpackage-SVNTRRev94-0044.el6.x86_64.rpm

Then did some google search and identified that my package was built using higher version of rpm and i tried installing it in machine which has lower version of rpm.
[root@testsys1 x86_64]# rpm --version
RPM version 4.8.0
[root@qasys1 x86_64]# rpm --version
RPM version 4.4.2.3

The features available in the higher version weren't available in the lowest version,
[root@testsys1 x86_64]# rpm --showrc
Features supported by rpmlib:
  rpmlib(BuiltinLuaScripts) = 4.2.2-1
  rpmlib(CompressedFileNames) = 3.0.4-1
  rpmlib(ConcurrentAccess) = 4.1-1
  rpmlib(ExplicitPackageProvide) = 4.0-1
  rpmlib(FileCaps) = 4.6.1-1
 rpmlib(FileDigests) = 4.6.0-1
  rpmlib(HeaderLoadSortsTags) = 4.0.1-1
  rpmlib(PartialHardlinkSets) = 4.0.4-1
  rpmlib(PayloadFilesHavePrefix) = 4.0-1
  rpmlib(PayloadIsBzip2) = 3.0.5-1
  rpmlib(PayloadIsLzma) = 4.4.2-1
  rpmlib(PayloadIsXz) = 5.2-1
  rpmlib(ScriptletInterpreterArgs) = 4.0.3-1
  rpmlib(VersionedDependencies) = 3.0.3-1
[root@qasys1 x86_64]# rpm --showrc
Features supported by rpmlib:
  rpmlib(VersionedDependencies) = 3.0.3-1
  PreReq:, Provides:, and Obsoletes: dependencies support versions.
  rpmlib(CompressedFileNames) = 3.0.4-1
  file name(s) stored as (dirName,baseName,dirIndex) tuple, not as path.
  rpmlib(PayloadIsBzip2) = 3.0.5-1
  package payload can be compressed using bzip2.
  rpmlib(PayloadFilesHavePrefix) = 4.0-1
  package payload file(s) have "./" prefix.
  rpmlib(ExplicitPackageProvide) = 4.0-1
  package name-version-release is not implicitly provided.
  rpmlib(HeaderLoadSortsTags) = 4.0.1-1
  header tags are always sorted after being loaded.
  rpmlib(ScriptletInterpreterArgs) = 4.0.3-1
  the scriptlet interpreter can use arguments from header.
  rpmlib(PartialHardlinkSets) = 4.0.4-1
  a hardlink file set may be installed without being complete.
  rpmlib(ConcurrentAccess) = 4.1-1
  package scriptlets may access the rpm database while installing.
  rpmlib(BuiltinLuaScripts) = 4.2.2-1
  internal support for lua scripts.

Now i could see the reason for the dependency failure ,  features rpmlib(FileDigests) ,rpmlib(PayloadIsXz) aren't available in the lower version of rpm and that's the reason for the failure of the installation of rpm. I decided to build my package without this features so that it can install in my QA machine without upgrading the rpm or installing the dependencies. I know this is not the right approach  as these features might provide a useful functionality  and i didn't explore what those are. But in my case the package just places files in certain directory structure with right permission bits, so i decided to disable these features and build the package.

[root@testsys1 x86_64]# rpmbuild -bb --define "_binary_filedigest_algorithm  1"  --define "_binary_payload 1" testpackage.spec

Then i installed the package in the QA machine without dependency issue,
[root@qasys1 x86_64]# rpm -ivh testpackage-SVNTRRev94-0044.el6.x86_64.rpm
 Preparing... ########################################### [100%]
  1:testpackage ########################################### [100%]

Reference : http://bit.ly/VZR5gW

10 comments:

  1. Thanks so much for this post. You saved me a lot of time when I tried to create an RPM on CentOS 6.4 and install it on RHEL 5.5.

    ReplyDelete
  2. Was in the same situation as "Anonymous" you saved my day! You might want to do some formatting/code highlighting as in Safari it wasn't clear that it was --define (with two - ) and copy/paste would just throw a bunch of bad chars.

    ReplyDelete
  3. Thanks a lot! This post save my day (if I had found it earlier would have saved several other days)

    ReplyDelete
  4. This post saved me almost 2 hours of job. Nice information you got there. Thanks a lot!

    ReplyDelete
  5. Updated the post with format correction, thanks for pointing out.

    ReplyDelete
  6. This article solved a problem I was looking at for hours... Well written and detailed... Thanks very much,

    ReplyDelete
  7. Hi Madhu,

    In your example , what is "testpackage.spec" and from where you got it ?

    ReplyDelete
    Replies
    1. testpackage.spec is the source code of the RPM. You need to write it , in this case testpackage.spec was written by me to create the tesppackage rpm. Check this http://www.tldp.org/HOWTO/RPM-HOWTO/build.html , there are lot of resources to learn how to create rpm spec file.

      Delete
  8. Thank you! We still have to support older installations with new packages and your solution worked for us.

    ReplyDelete