Architecture-specific Dependencies issue in rpm across Red Hat Enterprise Linux 5 and 6

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Issue

  • Trying to build a RPM package for Red Hat Enterprise Linux 5 and cannot get the arch specific dependencies to work.
  • All macros tried get literally passed to yum, and the install failed due to missing dependencies.
  • Have tried:
Requires: pam.%{__isa_name}-32)
Requires: pam.i386
Requires: pam.(x86-32)
  • None of these work and get passed directly to yum:
Missing Dependency: pam(%{__isa_name}-32)
Missing Dependency: pam.(x86-32)
Missing Dependency: pam.i386
  • Is there any problem with RPM?

Resolution

  • This is not problem of rpm. Package pam on RHEL5 doesn't provide pam(x86-32). Have a look at output of command rpm -q --provides pam in RHEL5 and RHEL6.
  • For Red Hat Enterprise Linux 6:
# rpm -q --provides --nosignature -p pam-1.1.1-17.el6.i686.rpm | grep 'pam(x86-32)' | wc -l
1
# rpm -q --provides --nosignature -p pam-1.1.1-17.el6.i686.rpm | grep 'pam(x86-32)'
pam(x86-32) = 1.1.1-17.el6
  • For Red Hat Enterprise Linux 5:
# rpm -q --provides --nosignature -p pam-0.99.6.2-6.el5_5.2.i386.rpm | grep 'pam(x86-32)' | wc -l
0
# rpm -q --provides --nosignature -p pam-0.99.6.2-6.el5_5.2.i386.rpm | grep 'pam(x86-32)'
#
  • Red Hat Enterprise Linux 5 rpm does not create those ISA provides, that feature got added in rpm 4.6. And it wont be backported because it would be mostly useless without also rebuilding the entire distribution to get those provides into all packages, and that is certainly not going to happen.

Diagnostic Steps

Steps to Understand the problem

  • On Red Hat Enterprise Linux 5:
[root@localhost ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 5.7 (Tikanga)
[root@localhost ~]# cat /root/rpmbuild/SPECS/test.spec 
Name:           test
Summary:        test
Version:    1
Release:    0
License:        GPL 
URL:            https://www.redhat.com
BuildRoot:      %{_tmppath}/test
Requires:       pam(x86-32)
GROUP:      Development/Libraries
SOURCE0:    test.tar.gz
%description

%prep

%build

%install

%clean

%files

%changelog

[root@localhost ~]# rpmbuild -ba /usr/src/redhat/SPECS/test.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.95653
+ umask 022
+ cd /usr/src/redhat/BUILD
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.95653
+ umask 022
+ cd /usr/src/redhat/BUILD
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.95653
+ umask 022
+ cd /usr/src/redhat/BUILD
+ /usr/lib/rpm/brp-compress
/usr/lib/rpm/brp-compress: line 8: cd: /var/tmp/test: No such file or directory
+ /usr/lib/rpm/brp-strip
find: /var/tmp/test: No such file or directory
+ /usr/lib/rpm/brp-strip-static-archive
find: /var/tmp/test: No such file or directory
+ /usr/lib/rpm/brp-strip-comment-note
find: /var/tmp/test: No such file or directory
Processing files: test-1-0
Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/test
Wrote: /usr/src/redhat/SRPMS/test-1-0.src.rpm
Wrote: /usr/src/redhat/RPMS/x86_64/test-1-0.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.95653
+ umask 022
+ cd /usr/src/redhat/BUILD
+ exit 0

[root@localhost ~]# yum localinstall /usr/src/redhat/RPMS/x86_64/test-1-0.x86_64.rpm 
Loaded plugins: product-id, rhnplugin, security, subscription-manager
Updating Red Hat repositories.
This system is not registered with RHN Classic or RHN Satellite.
You can use rhn_register to register.
RHN Satellite or RHN Classic support will be disabled.
Setting up Local Package Process
Examining /usr/src/redhat/RPMS/x86_64/test-1-0.x86_64.rpm: test-1-0.x86_64
Marking /usr/src/redhat/RPMS/x86_64/test-1-0.x86_64.rpm to be installed
test                                                                                                                                   | 1.5 kB     00:00     
Resolving Dependencies
--> Running transaction check
---> Package test.x86_64 0:1-0 set to be updated
--> Processing Dependency: pam(x86-32) for package: test
--> Finished Dependency Resolution
test-1-0.x86_64 from /test-1-0.x86_64 has depsolving problems
  --> Missing Dependency: pam(x86-32) is needed by package test-1-0.x86_64 (/test-1-0.x86_64)
Error: Missing Dependency: pam(x86-32) is needed by package test-1-0.x86_64 (/test-1-0.x86_64)
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest

[root@localhost ~]# rpm -qRp /usr/src/redhat/RPMS/x86_64/test-1-0.x86_64.rpm
pam(x86-32)  
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
[root@localhost ~]# rpm -ivh /usr/src/redhat/RPMS/x86_64/test-1-0.x86_64.rpm
error: Failed dependencies:
    pam(x86-32) is needed by test-1-0.x86_64
  • On Red Hat Enterprise Linux 6:
[root@localhost ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.5 (Santiago)
[root@localhost ~]# cat /root/rpmbuild/SPECS/test.spec 
Name:           test
Summary:        test
Version:    1
Release:    0
License:        GPL 
URL:            https://www.redhat.com
BuildRoot:      %{_tmppath}/test
Requires:       pam(x86-32)
GROUP:      Development/Libraries
SOURCE0:    test.tar.gz
%description

%prep

%build

%install

%clean

%files

%changelog

[root@localhost ~]# rpmbuild -ba rpmbuild/SPECS/test.spec
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.Yl5zjw
+ umask 022
+ cd /root/rpmbuild/BUILD
+ exit 0
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.VIpZcU
+ umask 022
+ cd /root/rpmbuild/BUILD
+ exit 0
Executing(%install): /bin/sh -e /var/tmp/rpm-tmp.Tok96h
+ umask 022
+ cd /root/rpmbuild/BUILD
+ /usr/lib/rpm/brp-compress
/usr/lib/rpm/brp-compress: line 8: cd: /root/rpmbuild/BUILDROOT/test-1-0.x86_64: No such file or directory
+ /usr/lib/rpm/brp-strip
find: `/root/rpmbuild/BUILDROOT/test-1-0.x86_64': No such file or directory
+ /usr/lib/rpm/brp-strip-static-archive
find: `/root/rpmbuild/BUILDROOT/test-1-0.x86_64': No such file or directory
+ /usr/lib/rpm/brp-strip-comment-note
find: `/root/rpmbuild/BUILDROOT/test-1-0.x86_64': No such file or directory
Processing files: test-1-0.x86_64
Checking for unpackaged file(s): /usr/lib/rpm/check-files /root/rpmbuild/BUILDROOT/test-1-0.x86_64
Wrote: /root/rpmbuild/SRPMS/test-1-0.src.rpm
Wrote: /root/rpmbuild/RPMS/x86_64/test-1-0.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.IejvLs
+ umask 022
+ cd /root/rpmbuild/BUILD
+ exit 0

[root@localhost ~]# yum localinstall /root/rpmbuild/RPMS/x86_64/test-1-0.x86_64.rpm 
Loaded plugins: product-id, rhnplugin, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
This system is not registered with RHN Classic or RHN Satellite.
You can use rhn_register to register.
RHN Satellite or RHN Classic support will be disabled.
Setting up Local Package Process
Examining /root/rpmbuild/RPMS/x86_64/test-1-0.x86_64.rpm: test-1-0.x86_64
Marking /root/rpmbuild/RPMS/x86_64/test-1-0.x86_64.rpm to be installed
test                                                                                                                                   | 3.9 kB     00:00 ... 
Resolving Dependencies
--> Running transaction check
---> Package test.x86_64 0:1-0 will be installed
--> Processing Dependency: pam(x86-32) for package: test-1-0.x86_64
--> Running transaction check
---> Package pam.i686 0:1.1.1-17.el6 will be installed
--> Processing Dependency: libutil.so.1(GLIBC_2.0) for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libutil.so.1 for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libselinux.so.1 for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libnsl.so.1(GLIBC_2.0) for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libnsl.so.1 for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libdl.so.2(GLIBC_2.1) for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libdl.so.2(GLIBC_2.0) for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libdl.so.2 for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libdb-4.7.so for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libcrypt.so.1(GLIBC_2.0) for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libcrypt.so.1 for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libcrack.so.2 for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libc.so.6(GLIBC_2.8) for package: pam-1.1.1-17.el6.i686
--> Processing Dependency: libaudit.so.1 for package: pam-1.1.1-17.el6.i686
--> Running transaction check
---> Package audit-libs.i686 0:2.2-2.el6 will be installed
---> Package cracklib.i686 0:2.8.16-4.el6 will be installed
---> Package db4.i686 0:4.7.25-18.el6_4 will be installed
---> Package glibc.i686 0:2.12-1.132.el6 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.132.el6.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.132.el6.i686
---> Package libselinux.i686 0:2.0.94-5.3.el6_4.1 will be installed
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.14.3-9.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================
 Package                                  Arch                         Version                                   Repository                              Size
=======================================================================
Installing:
 test                                     x86_64                       1-0                                       /test-1-0.x86_64                       0.0  
Installing for dependencies:
 audit-libs                               i686                         2.2-2.el6                                 test                                    60 k
 cracklib                                 i686                         2.8.16-4.el6                              test                                    70 k
 db4                                      i686                         4.7.25-18.el6_4                           test                                   580 k
 glibc                                    i686                         2.12-1.132.el6                            test                                   4.3 M
 libselinux                               i686                         2.0.94-5.3.el6_4.1                        test                                   108 k
 nss-softokn-freebl                       i686                         3.14.3-9.el6                              test                                   147 k
 pam                                      i686                         1.1.1-17.el6                              test                                   659 k

Transaction Summary
=======================================================================
Install       8 Package(s)

Total download size: 5.9 M
Installed size: 18 M
Is this ok [y/N]: N
Exiting on user Command
[root@localhost ~]# rpm -qRp /root/rpmbuild/RPMS/x86_64/test-1-0.x86_64.rpm 
pam(x86-32)  
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(CompressedFileNames) <= 3.0.4-1
[root@localhost ~]# rpm -ivh /root/rpmbuild/RPMS/x86_64/test-1-0.x86_64.rpm
error: Failed dependencies:
    pam(x86-32) is needed by test-1-0.x86_64

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments