Formats Error (could not find ldd binary)! - linux

I'm using CentOS5 and trying to install a script that requires ldd.
I've tried:
yum install gcc glibc glibc-common
yum update gcc glibc glibc-common
Yum reinstall yum gcc glibc glibc-common
The first two say it's already installed, the latter obviously just reinstalls without error.
So my problem is the script I'm using (AVS) still claims the ldd binary is missing.
Is there a default directory where it should be installed? I have the following files:
ld
ldd
lddlibc4
In both /usr/bin and /usr/local/bin
Any help is greatly appreciated.

ldd is not a binary, it is a Text file, with bash script inside. You should debug your script (AVS) or contact with its author.

You may have removed ldd executable manually and yum/rpm can not detect that. You can download the "glibc-common" rpm package from some mirror and reinstall it by force.

Related

How to fix 'Unable to locate package' error in apt-cyg

Im using Cygwin and I need to install a g++ compiler, so I tried with apt-cyg.
It returns an error that happens with some packages but not with others. For instance, I could install git package, which I found in blogs that talk about this topic to try it as an example. However, when trying g++:
$ apt-cyg install g++
Installing g++
Unable to locate package g++
What is going on?
First, I would suggest you use the standard Cygwin setup-x86_64.exe (or its 32-bit version if appropriate) rather than apt-cyg. Scanning the "Devel" category in setup, you will see a package gcc-g++, which is what you want.
The answer from #varro is correct. However, if you wish to use apt-cyg, you should take advantage of it's search capabilities.
apt-cyg search g++
returns gcc-g++.
Thus, you can execute the following apt-cyg command to install g++:
apt-cyg install gcc-g++

gcc available, but not installed in fedora

I installed gcc using sudo yum install gcc then I try compile c program it say gcc command not found then I try to update the gcc using sudo yum update gcc then it say Page(s) gcc available, but not installed I try to find an answer in google, but I'm unable to fined the solution. please can anyone help me ?
These steps might help check what the cause could be.
rpm -q gcc --> check if gcc is installed and managed by yum/rpm
which gcc --> check if gcc is in your search path for executables
gcc --version --> check if gcc works in the simplest way (perhaps the error came from incorrect source file path passed to it)
Finally I found the answer, first I did yum update audit then I install gcc using yum install gcc it works fine, thank you for your help

Fedora - Reinstalling GMP with C++ support

I'm trying to install a library that uses gmp and am running the ./configure on it.
So far, I've gotten past several snags, such as requiring gcc, g++, and m4 by using:
yum install gcc
yum install gcc-g++
yum install m4
Now I'm getting this error:
checking for the GMP library version 4.1.3 or above... no
configure: error: Cannot find GMP version 4.1.3 or higher.
GMP is the GNU Multi-Precision library:
see http://www.swox.com/gmp/ for more information.
When compiling the GMP library, do not forget to enable the C++ interface:
add --enable-cxx to the configuration options.
As such, I tried both installing and updating gmp using yum:
yum install gmp
yum update gmp
Install tells me it's already installed and is v. 5.1.2
Updating says there's nothing to update.
I went to the gmp site and it is currently v. 6.0.0
I downloaded it and ran configure (using --enable-cxx), make, and make install.
Yet, nothing has changed. It still says I have v. 5.1.2 and the configure for the library still says it can't find 4.1.3 and above / try enabling c++.
The gmp files (such as gmp.h) are being placed in /usr/local/lib and /include
I've been at this for hours without any progress. I'm rather new to linux so I imagine there's something I just don't know about.
Am I not installing 6.0.0 correctly to overwrite the already installed one?
Or is there a way to reinstall the original with the c++ option?
Any help would be appreciated. Thanks.
dnf install gmp-devel resolved this for me on rhel
When you manually install something, as you have, it doesn't get installed in the normal /usr/lib directory and therefore it doesn't overwrite it. This is a good thing. In general, you shouldn't mess with files installed by the package manager. (Except in the case that they are config files that are meant to be edited.)
When you install manually, it is installed to /usr/local/lib. Fortunately, GCC and other compilers don't care which directory something is installed in, they will find it (when it's in standard places like /usr/* or /usr/local/*).
Just include the C++ header and add the correct -l library flag.
I figured it out.
Under the --help section of the ./configure for the library I was trying to install, there was actually a feature just for this:
--with-gmp-include=DIR
--with-gmp-lib=DIR
Using these, I was able to get it to install.
Thanks for the help.
I think I was too focused on trying to update the system install of gmp.

How to specify dependency location in rpm?

While installing Mono using RPM, GLIBC_2.16 is listed as a dependency. Since I'm having an older version of glibc, and didn't want to corrupt my kernel, i installed the newer glibc from sources in my home folder.
I now want the RPM to refer to this newer glibc lib directory in my home folder while installing mono. What is the RPM option for mentioning dependency locations for a package?
I am currently using the following RPM command:
sudo rpm -ivh mono-core-3.2.3-0.x86_64.rpm
I get the following error messages:
libc.so.6(GLIBC_2.14)(64bit) is needed by mono-core-3.2.3-0.x86_64
libc.so.6(GLIBC_2.15)(64bit) is needed by mono-core-3.2.3-0.x86_64
libc.so.6(GLIBC_2.16)(64bit) is needed by mono-core-3.2.3-0.x86_64
My newer glibc path is:
~/Desktop/glibc/glibc1/lib
What option should i include in rpm to reference this path while installing mono?
Thanks
I guess there is no way to install the package without --nodeps unless you install the proper version of glibc in your system.
If your goal is to run mono command completely, it may work fine by the following steps.
Installing the package by adding the --nodeps option to rpm command to ignore any dependencies.
Running mono-related commands with LD_LIBRARY_PATH set to /your/alternative/path/to/glibc.
However, I think that the best solution is to build the mono's source on your machine.

/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