perl/bin/perl: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory
I was trying to install Oracle DB 21.0.0.0 on RHEL 8.4, but facing below error while executing runInstaller command due to which installation was aborted.
Error Description:
su - oracle
cd /u01/app/oracle/product/21.0.0/dbhome_1
[oracle@myblog dbhome_1]$ ./runInstaller
/u01/app/oracle/product/21.0.0/dbhome_1/perl/bin/perl: error while loading shared libraries: libnsl.so.1: cannot open shared object file: No such file or directory
[oracle@myblog dbhome_1]$
Solution:
Use below command check whether library "libnsl.so.1:" exists on server or not.
$su -
[root@myblog ~]# ldd /u01/app/oracle/product/21.0.0/dbhome_1/perl/bin/perl
linux-vdso.so.1 (0x00007ffd6addf000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2e67321000)
libnsl.so.1 => not found
libdl.so.2 => /lib64/libdl.so.2 (0x00007f2e6711d000)
libm.so.6 => /lib64/libm.so.6 (0x00007f2e66d9b000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f2e66b72000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f2e6696e000)
libc.so.6 => /lib64/libc.so.6 (0x00007f2e665a9000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f2e66391000)
/lib64/ld-linux-x86-64.so.2 (0x00007f2e67541000)
Here, we can see that the library "libnsl.so.1:" is missing on server causing the issue. You can also verify the same by using below command. It shows whether respective packages are installed on server or not.
[root@myblog ~]# dnf -q repoquery -f \*/libnsl.so.1
[root@myblog Oracle 21c]# cd /usr/lib64
[root@myblog lib64]# ls -ltr libnsl.so*
lrwxrwxrwx. 1 root root 15 Aug 12 2018 libnsl.so.2 -> libnsl.so.2.0.0
-rwxr-xr-x. 1 root root 116408 Aug 12 2018 libnsl.so.2.0.0
Solution is to install respective RPM packges through manual method or through Yum repository.
Here, i am using Yum repository method to install missing packges.
1) Mount the RHEL Setup CD and search the file "media.repo" file from mounted location.
Here, the mounted location is /media/sf_new/.
2) Copy the media.repo file from RHEL OS setup location "/media/sf_new/BaseOS/" to location "/etc/yum.repos.d/".
root@myblog sf_new]# cp media.repo /etc/yum.repos.d/rhel7dvd.repo
3) Make below changes in file "/etc/yum.repos.d/rhel7dvd.repo" i.e. set gpgcheck=1 and add below three parameters.
- gpgcheck=1
- enabled=1
- baseurl=file:///media/sf_new/BaseOS/
- gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
Old File:
[root@myblog sf_new]# cat /etc/yum.repos.d/rhel7dvd.repo
[InstallMedia]
name=Red Hat Enterprise Linux 8.4.0
mediaid=None
metadata_expire=-1
gpgcheck=0
cost=500
New File:
[root@myblog repodata]# cat /etc/yum.repos.d/rhel7dvd.repo
[InstallMedia]
name=Red Hat Enterprise Linux 8.4.0
mediaid=None
metadata_expire=-1
gpgcheck=1
cost=500
enabled=1
baseurl=file:///media/sf_new/BaseOS/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@myblog repodata]#
"/media/sf_new/BaseOS/" is a location where all RPMs are located from RHEL Image copy software.
[root@myblog sf_new]# chmod 644 /etc/yum.repos.d/rhel7dvd.repo
4) Install missing RPMs by using below command:
[root@myblog lib64]# yum install libnsl
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:05:02 ago on Fri 10 Jun 2022 02:49:06 PM IST.
Package libnsl-2.28-151.el8.i686 is already installed.
Dependencies resolved.
=======================================================================================================================
Package Architecture Version Repository Size
=======================================================================================================================
Installing:
libnsl x86_64 2.28-151.el8 InstallMedia 102 k
Transaction Summary
=======================================================================================================================
Install 1 Package
Total size: 102 k
Installed size: 160 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : libnsl-2.28-151.el8.x86_64 1/1
Running scriptlet: libnsl-2.28-151.el8.x86_64 1/1
Verifying : libnsl-2.28-151.el8.x86_64 1/1
Installed products updated.
Installed:
libnsl-2.28-151.el8.x86_64
Complete!
[root@myblog lib64]#
5) Now verify missing library files exist or not. You can see the below output where the missing library file "libnsl.so.1:" exists post installing RPMs.
[root@myblog lib64]# ldd /u01/app/oracle/product/21.0.0/dbhome_1/perl/bin/perl
linux-vdso.so.1 (0x00007fffcb70d000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007ff21d841000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x00007ff21d628000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007ff21d424000)
libm.so.6 => /lib64/libm.so.6 (0x00007ff21d0a2000)
libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007ff21ce79000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007ff21cc75000)
libc.so.6 => /lib64/libc.so.6 (0x00007ff21c8b0000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007ff21c698000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff21da61000)
[root@myblog lib64]#
[root@myblog ~]# dnf -q repoquery -f \*/libnsl.so.1
libnsl-0:2.28-151.el8.i686
libnsl-0:2.28-151.el8.x86_64
Now post fixing the above issue, installation screen appeared.
Please comment if you like this post !
Very useful
ReplyDelete