user3325376
user3325376

Reputation: 198

how to add custom path for rpm dependencies

I am trying to install some software that's required glib 2.14

so I installed it with this tutorial: How to upgrade glibc from version 2.12 to 2.14 on CentOS?

the problem is glib 2.14 path is /opt/glibc-2.14/lib/libc.so.6

so when I try to install software using rpm i still getting this error:

error: Failed dependencies:
        libc.so.6(GLIBC_2.14)(64bit) is needed by xyz-4.6.6-1.x86_64
        libc.so.6(GLIBC_2.15)(64bit) is needed by xyz-4.6.6-1.x86_64
        libc.so.6(GLIBC_2.17)(64bit) is needed by xyz-4.6.6-1.x86_64

how can I add the custom path for rpm dependencies?

Upvotes: 0

Views: 2698

Answers (1)

sneep
sneep

Reputation: 1918

It would help a bit if you gave us the name of the package you are trying to install. You can't just provide a path, RPM checks if it's got any packages on record that provide these libraries, and there aren't any. Here are a couple methods you could use:

  1. Use --nodeps

    If you already know that you have everything that is required, using --nodeps is completely fine IMO.

  2. Create virtual packages for the missing libraries (advanced)

    You are missing the following libraries: libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.15)(64bit) libc.so.6(GLIBC_2.17)(64bit).

    Here's an example .spec file to create a virtual package that claims to provide these libraries:

    Name: libc-virtual-provides
    Provides: libc.so.6(GLIBC_2.14)(64bit)
    Provides: libc.so.6(GLIBC_2.15)(64bit)
    Provides: libc.so.6(GLIBC_2.17)(64bit)
    Version: 1.0
    Release: 1
    Summary: Virtual package providing libc 2.14, 2.15, 2.17
    License: Public domain
    
    %description
    Virtual package providing libc 2.14, 2.15, 2.17
    
    %prep
    
    %files
    
    %changelog
    

    To create a virtual package from this SPEC file, first create some directories:

    mkdir -p ~/rpmbuild/BUILD ~/rpmbuild/BUILDROOT ~/rpmbuild/RPMS ~/rpmbuild/SOURCES ~/rpmbuild/SPECS ~/rpmbuild/SRPMS
    

    Then copy the SPEC file into ~/rpmbuild/SPECS, and build an RPM:

    cp virtual-glibc-provides.spec ~/rpmbuild/SPECS
    cd ~/rpmbuild/SPECS
    rpmbuild -ba virtual-glibc-provides.spec
    

    You'll get output like this:

    Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.6Jni5u
    + umask 022
    + cd /home/.../rpmbuild/BUILD
    + exit 0
    Processing files: glib2.14-virtual-provides-2.14-1.x86_64
    Checking for unpackaged file(s): /usr/lib/rpm/check-files /home/.../rpmbuild/BUILDROOT/glib2.14-virtual-provides-2.14-1.x86_64
    Wrote: /home/.../rpmbuild/SRPMS/glib2.14-virtual-provides-2.14-1.src.rpm
    Wrote: /home/.../rpmbuild/RPMS/x86_64/glib2.14-virtual-provides-2.14-1.x86_64.rpm
    Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.YNj8gP
    + umask 022
    + cd /home/.../rpmbuild/BUILD
    + /bin/rm -rf /home/.../rpmbuild/BUILDROOT/glib2.14-virtual-provides-2.14-1.x86_64
    + exit 0
    

    And you'll have your RPM under /home/.../rpmbuild/RPMS/, which you can then install using rpm -ivh ....rpm. You should then be able to install the other package without any problems.

Upvotes: 4

Related Questions