Manully installing a shared library

I'm working with a 64 bit RedHat based Linux (Oracle EL 6.1).

[root@dbserver ~]# uname -r
2.6.32-100.34.1.el6uek.x86_64

I have extracted a 32 bit shared library from within a RPM (rpm2cpio xx.rpm | cpio -idmv) and copied it to /lib. Then ran the ldconfig to update the cache. I can see the symbolic link is created in /lib as well.

[root@testserver ~]# ldconfig -p | grep -i /lib/libexpat
libexpat.so.1 (libc6) => /lib/libexpat.so.1

[root@testserver ~]# cd /lib
[root@testserver lib]# ls -l libexpat*
lrwxrwxrwx. 1 root root 17 Aug 19 12:53 libexpat.so.1 -> libexpat.so.1.5.2
-rwxr-xr-x. 1 root root 160168 Aug 19 12:08 libexpat.so.1.5.2

However, when I want to install other 32-bit RPMs that depend on libexpat.so.1, it's reported as missing: libexpat.so.1 is needed by XXX.rpm

Any help is greatly appreciated.

What is the exact command you are using to install the other 32-bit RPMs?

rpm -ivh XXX.rpm

maybe it wants the .so file under /usr/lib and not /lib. Try that, create a soft link under /usr/lib

I have. But no joy.

[root@testserver lib]# ls -l /usr/lib/libexpat*
lrwxrwxrwx. 1 root root 27 Aug 19 13:16 /usr/lib/libexpat.so.1 -> ../../lib/libexpat.so.1.5.2

Just copying the right file into the right place doesn't mean RPM knows about it.

RPM is supposed to track not just the existence of a file but its versions and so forth, so it keeps its own records of what's around. You might have to force it to install without dependencies, but that could have bad consequences later.

Doesn't ldconfig share the library system-wide?

It means anything can load the library. It doesn't mean RPM understands and acknowledges its existence. RPM didn't install that file, therefore RPM is not aware of it.

Thanks for the answers. You see, I don't use RPMs that much. I know that there is a local RPM database that keeps track of installed RPMs which I believe that's not what you are referring to. So I'm wondering how RPMs get to know what shared libraries exist in the system.

By installing them in the first place. That's how RPM's supposed to resolve dependencies.

Sorry, it is.