libstdc++.so.5: cannot open shared object file - but library is installed and up-to-date - linux

My client had some developer write a small c++ command-line app to run on their Linux servers. On one of the servers (running Fedora 11), when I execute the app I get the following error:
error while loading shared libraries: libstdc++.so.5: cannot open shared object file: No such file or directory
Obviously the first thing I did was
yum install libstdc++
But I get
Package libstdc++-4.4.1-2.fc11.x86_64 already installed and latest version
So the library already exists and is up-to-date. Usually to me these errors indicate a missing library. So where should I look next?

rpm hence the repo knows about shared library names and what provides them. So
yum install 'libstdc++.so.5'
wiil install whatever is necessary if the repo has it.
In your case it would fetch compat-libstdc++-33-3.2.3-66.i586.rpm and its 32-bit deps if you don't have them already because the binary you are trying to run is apparently 32-bit

libstdc++-4.4.1-2.fc11.x86_64 installs libstdc++.so.6. You need the compat-libstdc++-33-3.2.3-66.x86_64 package to get libstdc++.so.5. (Do not symlink! libstdc++.so.5 and libstdc++.so.6 are incompatible.)

yum install compat-libstdc++-33 solved this for me.

libstdc++.so.5 is a very old version of the standard c++ library.
Do a yum search libstdc++ , you'll have to install one of the compat-libstdc++ packages.

As stated by caf and aaron, running yum install compat-libstdc++-33 libstdc++.so.5 -y worked for me when I got a similar error.
The only catch I ran into was, I didn't have the correct repo checked out so I had to run yum-config-manager --enable rhel-7-server-optional-rpms to access the files. If you are using something other than RedHat 7 you will need to search for the correct repo.
You could always check if you have the correct repo by running yum provides libstdc++.so.5 first.

worked for me too on RedHat 7 : error was :
error while loading shared libraries: libstdc++.so.5: wrong ELF class: ELFCLASS32
The solution was :
yum install compat-libstdc++-33 libstdc++.so.5 -y

Have you checked that the package does install libstdc++.so.5 and not some other version? That's your most likely problem.

Related

missing libmpfr.so.6 when using a cross-compiler

I am using Ubuntu 18.04
I built a mips cross-compiler using buildroot, but when I tried to test whether it would work,I got this message
/home/daisy/repos/repo/buildroot/output/host/bin/../libexec/gcc/mipsel-buildroot-linux-uclibc/9.3.0/cc1: error while loading shared libraries: libmpfr.so.6: cannot open shared object file: No such file or directory
I searched for solutions , one of which said this:
sudo pacman -S mpfr
Well , my Linux isn't archlinux, this didn't work for me.
somebody please tells me how to deal with it.
The above suggestions of installing libmpfr on your host system are wrong. Buildroot is supposed to have build libmpfr, it should be present in host/lib, and picked up by the cross-compiler by virtue of it having a proper RPATH. If it doesn't work, we need to figure out why, but the correct thing is not to install libmpfr on your host system.
In Ubuntu, apt command (Advanced Packaging Tool) is used for performing such functions as installation of new software packages, upgrade of existing software packages, updating of the package list index, and even upgrading the entire Ubuntu system.
Try this command :-
sudo apt-get update
sudo apt install libmpfr6
This will install shared libraries: libmpfr.so.6 to your Ubuntu system.
Hope It Helps !

shared libraries libgconf-2.so.4 is missing

I want to install chromedriver in one of the AWS EC2 instance which is linux(Red Hat Enterprise Linux Server release 6.7 Santiago - 64 bit). While installing the chromedriver, we ran into issue due to missing packages. I could find the package here but this in turn requires many other packages. Using any other AMI is not an option.
Error is -
error while loading shared libraries libgconf-2.so.4 cannot open shared object file
I am using Ubuntu x64 and yum didn't work for me. But I found somebody mentioning simply use
$sudo apt install libgconf-2-4
worked for me to install the libgconf.
Please ask yum for the file, libgconf-2.so.4 : $ yum provides */libgconf-2.so.4
Install GConf2 : # yum install GConf2
Packages http://mirror.centos.org/centos/6.8/os/ ... and updates http://mirror.centos.org/centos/6.8/updates/
The chromedriver depends on the same packages / files as GConf2, and then some. Please see for yourself : $ ldd chromedriver , where 'chromedriver' is the unzipped executable.
EDIT :
Solution for the chromedriver issue : Install a chromedriver for RHEL 6, chromedriver-31.0.1650.63-1.el6.x86_64.rpm https://drive.google.com/file/d/0B7S255p3kFXNX1c0UWlGOWpZOHM/view?usp=sharing
Please download the package, and 1) cd Downloads/ 2) yum install chromedriver-31.0.1650.63-1.el6.x86_64.rpm ... and you have /usr/local/bin/chromedriver
P.S. : The EL6 chromedriver was built from the source package chromium-31.0.1650.63-1.el6.src.rpm
You might want to read this CentOS thread about your GLIBCXX_3.4.15. Especially apropos is this answer on the thread, especially the FAQ it references.
CentOS (which aims to be as compatible with RHEL as possible) is a curated LTS distribution (as is RHEL). You might find a version of chromedriver compiled for RHEL 6 in one of the many repositories. If not, you'll probably have to build it yourself.

System crash after oracle installation with yum

recently i tried to install oracle on my linux with apt (I never used yum before) using fast manual:
http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux-488779.html
And after command:
sudo yum install oracle-rdbms-server-11gR2-preinstall
I got error:
Failed: ca-certificates.noarch 0:2010.63-3.el6_1.5 chkconfig.x86_64 0:1.3.49.3-2.el6 file-libs.x86_64 0:5.04-15.el6 filesystem.x86_64 0:2.4.30-3.el6
initscripts.x86_64 0:9.03.38-1.0.1.el6_4.2
Complete!
And something gone wrong because command like: ps, top are crashing
login#Ass-K55VJ:/etc/yum/repos.d$ ps -e
ps: relocation error: ps: symbol procps_number_version, version _3_2_5 not defined in file libproc-3.2.8.so with link time reference
login#Ass-K55VJ:/etc/yum/repos.d$ top
Segmentation fault (core dumped)
then I tryied to uninstall oracle and dependencies but after command:
sudo yum remove oracle-rdbms-server-11gR2-preinstall
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
No module named yum
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.6.6 (r266:84292, Jul 10 2013, 06:42:56) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
If you cannot solve this problem yourself, please go to the yum faq at: http://wiki.linux.duke.edu/YumFaq
So it seems like yum install in my system new libraries but didn't link it correctly? I dont know what do in this moment because it seems like armagedon on my ubuntu...
Does this mean you're on ubuntu and tried to install rpm packages using yum? The manual you used is for Oracle Linux 6, why would you try that on ubuntu?
rpm packages are not compatible with debian based systems like ubuntu, which use deb packages. So you've probably screwed your system big time, overwriting important system libraries with incompatible ones.
If apt-get is still working, then you can try to reinstall (apt-get --reinstall install) the equivalent libraries to the ones mentioned in the install manual you linked to - naming isn't always the same for rpm and deb packages. dpkg -l should help you see which the correct installed libraries are. I'd start with the C libraries (libc) etc.
But if apt-get is screwed also, then you'd need to download the packages manually from an ubuntu mirror and install them using dpkg, but I think a reinstall (or restore from backup if you have one) would be the best option.

Installing Qt on linux, cannot find -lGL

I'm having a hard time trying to install Qt on linux. I downloaded the .run file on the website and installed Qt. However, when I try to compile the default Hello World project using Qtcreator, I get the following :
error cannot find -lGL
I was able to solve the problem by issuing the command :
sudo apt-get install libqt4-dev
But, I'm not satisfied with the solution as I want to use Qt5 and the name of the lib I downloaded implies version 4. Can someone explain what is going on and tell me if my solution is correct? If not, what should I do to get a working Qt on Linux.
Additional question
The correct answer, as provided by LtWorf, was to install libgl-dev. For future problems of this sort, can someone tell me how I should have guessed that I had to download this particular library? And why are there some libs with -dev at the end? What do they provide?
Well it is trying to link with libgl and doesn't find it. You should install libgl-dev.
-l is a linker option, it tells the linker to use a certain library.
For example you can have -lmagic meaning that you want to use libmagic.
Normally all libraries are called libsomething, and on debian you will find 3 packages called:
libsomething
libsomething-dbg
libsomething-dev
The 1st one is the library, the second one is the library compiled with the debug symbols, so you can make sense of stacktraces more easily, and the final one is the development package, it contains the .h files so you can link to the library.
sudo apt-get install libgl-dev
On Fedora 17, I did:
sudo yum install mesa-libGL-devel
Do you have libgl-dev installed? If not install it and it should work.
Those other posters are correct, but on some systems, the lib to install is named differently. I just dealt with a 32bit Ubuntu 14.04.5 LTS system, and libgl-dev was not available.
Instead, I needed to install the libgl1-mesa-dev package via:
sudo apt-get install libgl1-mesa-dev

/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory

I am trying to install roccc 2.0. I have installed required packages. Now while installing it, it is giving me this error:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
I searched for gnu/stubs-32.h and came to know, for Linux 64-bit its in glibc-devel and for Linux 32-bit, its in libc6-dev-i386.
I am using Linux 32-bit: i386 GNU/Linux, but couldn't get the lib required to resolve this error.
Can somebody please help me out?
If your Linux distro is Redhat based (Fedora/CentOS/RHEL):
yum install glibc-devel.i686
References
Original post answer solved this problem RHEL x64
Header file gnu/stubs-32.h is under /usr/include/i386-linux-gnu/ but the install script tries to find it in /usr/include/, try this quick fix to complete the installation:
sudo ln -s /usr/include/i386-linux-gnu/gnu/stubs-32.h /usr/include/gnu/stubs-32.h
After installation is finished, you can delete the link.
The package name keeps on changing, just do a
yum list glibc-devel
to find out current package for 32 bit. In my case it only listed 2 packages one for 32 bit and one for 64 bit. I just installed the 32 bit using
yum install glibc-devel.i686
Install 'glibc-devel' package, or whatever it called in your distro. You may also need to install ia32-libs lib32z1-dev lib32bz2-dev (names could be different in your distro).
The script is trying to get stubs-32.h from /usr/include/ where it is not found. To solve this you have to add an "include" path (by default it is /usr/include) like this:
C_INCLUDE_PATH=/usr/include/i386-linux-gnu/
export C_INCLUDE_PATH
OR
export C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)
You can visit Error "gnu/stubs-32.h: No such file or directory" while compiling Nachos source code for additional reference.
If on a Red Hat distro such as Fedora/CentOS/RHEL you can do the following to find out what package provides a given file:
$ repoquery -qf */stubs-32.h
glibc-devel-0:2.17-260.el7.i686
And then install it:
$ sudo yum install -y glibc-devel-0:2.17-260.el7.i686

Resources