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

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

Related

python3: can't install psycopg2 [duplicate]

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

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.

error while loading shared libraries: libncurses.so.5:

I've installed Android Studio and tried to run my first project in it, and I've got following error:
Error Output was: /home/user/android-studio/sdk/platform-tools/adb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
I've already tried to run
sudo ldconfig
but it doesnt help. I've recently installed libncurses (before using android studio).
What should I do?
If libncurses is not installed then install it and try again.
for 32-bit binaries : sudo apt-get install libncurses5:i386
for 64-bit binaries :
sudo apt-get install libncurses5
Also install the collection of libraries by using this command,
sudo apt-get install ia32-libs
error while loading shared libraries: libncurses.so.5
If you see this, your distro probably has a newer version of libncurse installed. First find out what version of libncurses your distro has:
$ ls -1 /usr/lib/libncurses*
/usr/lib/libncurses.so
/usr/lib/libncurses++.so
/usr/lib/libncurses++w.so
/usr/lib/libncursesw.so
/usr/lib/libncurses++w.so.6
/usr/lib/libncursesw.so.6
/usr/lib/libncurses++w.so.6.0
/usr/lib/libncursesw.so.6.0
In this case, we are dealing with version 6, so we make two symlinks:
$ sudo ln -s /usr/lib/libncursesw.so.6.0 /usr/lib/libncurses.so.5
$ sudo ln -s /usr/lib/libncursesw.so.6.0 /usr/lib/libtinfo.so.5
After this, the program should run normally.
If you are absolutely sure that libncurses, aka ncurses, is installed, as in you've done a successful 'ls' of the library, then perhaps you are running a 64 bit Linux operating system and only have the 64 bit libncurses installed, when the program that is running (adb) is 32 bit.
If so, a 32 bit program can't link to a 64 bit library (and won't locate it anyway), so you might have to install libcurses, or ncurses (32 bit version). Likewise, if you are running a 64 bit adb, perhaps your ncurses is 32 bit (a possible but less likely scenario).
For Redhat Linux 8 try this:
sudo yum install libncurses*
On Arch Linux you can install ncurses5-compat-libs AUR package.
FYI it is mentioned in Arch Wiki android page, just in case if you'll need some other dependencies for Android Studio: https://wiki.archlinux.org/index.php/Android
For Redhat Linux this helped,
sudo yum install ncurses-compat-libs
In Fedora 28 use:
sudo dnf install ncurses-compat-libs
I solved the issue using
ln -s libncursesw.so.5 /lib/x86_64-linux-gnu/libncursesw.so.6
on ubunutu 18.10
On Arch, i fix like this:
sudo ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.6
To install ncurses-compat-libs on Fedora 24 helped me on this issue
(unable to start adb error while loading shared libraries: libncurses.so.5)
Your system likely does not provide the ncurses library at the version android studio uses. My arch linux install only had ncurses 6 but android studio needs version 5.
You could check if your distribution has a compatability package, or use the solution that Rahmat Aligos suggested.
Mixaz's above answer worked for me. However I had issues installing the package because of PGP check failures. Installing it by skipping the signature worked, you could try this :
yaourt --m-arg "--skipchecksums --skippgpcheck" -Sb <your-package>

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

Apache2::Request (libapreq2-2.13) on centos 5.5

I'm having a torrid time installing Apache2::Request on Centos 5.5. My apache is the standard one that came with centos.
I'm installing from libapreq2-2.13 and a lot of dependencies didn't already exist. I so far had to do:
yum install httpd-devel # for apxs
I then did:
perl Makefile.PL --with-apache2-apxs=/usr/sbin/apxs
make
The make step then told me i needed: ExtUtils-XSBuilder and Parse-RecDescent, which i duly installed.
running make again gave the compiler error:
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/apreq_xs_postperl.h:22:34: error: modperl_perl_unembed.h: No such file or directory
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/apreq_xs_postperl.h:25:33: error: modperl_common_util.h: No such file or directory
In file included from Apache2.xs:45:
/home/xx/installers/libapreq2-2.13/glue/perl/xsbuilder/APR/Request/Apache2/APR__Request__Apache2.h:1:22: error: mod_perl.h: No such file or directory
Can anyone tell me which package i'm missing?
Is there not a method of installing this common package that "just works" (tm).
Many thanks
It's already packaged for Centos.
$ repoquery -i --whatprovides 'perl(Apache2::Request)'
perl-libapreq2-0:2.09-0.rc2.1.el5.x86_64
$ sudo yum install perl-libapreq2
(Actually, that only works if you're using the EPEL repository)
To install the headers , yum install mod_perl-devel

Resources