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