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

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>

Related

Error in rstudio : libuuid.so.1: cannot open shared object file: No such file or directory

I installed RStudio version 0.98.507 and my R version is 2.14.1. My OS is ubuntu 12.04. When I try to start RStudio from the terminal I get the following error:
rstudio: error while loading shared libraries: libuuid.so.1: cannot open shared object file: No such file or directory
How do I solve this?
apt-get install libuuid1
This command will not resolve the problem, if you are running 32 bit executable on 64 bit Ubuntu. Need to install 32 bit version of libuuid1 with `i386' suffix.
apt-get install libuuid1:i386
Try
sudo apt-get install libuuid1
Maybe you have some dependencies and, in fact, not completely installed.
When I tried to install, I got the following error:
dpkg: dependency problems prevent configuration of rstudio:
rstudio depends on libjpeg62; however:
Package libjpeg62 is not installed.
So I simply installed the dependency via apt-get:
sudo apt-get install libjpeg62
And then installed the rstudio:
sudo dpkg -i rstudio-<your_version>-amd64.deb
In case someone else comes across this problem, installing libuuid1 also did not work for me. This was because I had installed the 32 bit version of R studio when my system is 64 bit. So one solution is to install the 32 bit versions of the libraries, such as 'libuuid1:i386' in debian. The more simple and obvious solution is to just uninstall the current version of rstudio and install the 64 bit version. Worked like a charm!
installing the following package solved the problem for me. I am using ubuntu 12.04
sudo apt-get install ia32-libs

QT version is not properly installed, please run make install

I installed QT-creator from a downloaded copy of qt-creator-linux-x86-opensource-2.6.1.bin using
sudo ./qt-creator-linux-x86-opensource-2.6.1.bin
in Ubuntu 11.04
I tried to add QT versions in QT-Creator/Build/QT-versions configuration and it asked for a qmake executable.
I installed it using:
sudo apt-get install qt4-devel
which deployed qmake in /usr/bin/qmake
I selected it in QT-Creator/Build/QT-versions configuration as manual, Qt-4.7.2 (System) /usr/bin/qmake-qt4 but QT version is not properly installed, please run make install message appears and I can't use it in QT-Creator/Build/Kits configuration.
How can I solve the problem and configure qmake for Qt-creator use in project creation?
This solved the problem for me on recent Ubuntu version:
sudo apt-get install qt5-default
Just so this no longer shows up as unanswered:
To install all qt-devel libraries, use
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui
In Linux Mint 18.3 (32 bit) it also solved the problem:
sudo apt-get install qt5-default
So that Qt5 (5.5.1) was installed ready-to-use as a kit in QtCreator.
Although to install the Qt 5.9.0 version I had to explicitly download the package from https://download.qt.io/official_releases/qt/5.9/5.9.0/single/ (2 Gb unpacked) .
Then I had to run this command in terminal:
cd /home/username/Downloads/qt-everywhere-opensource-src-5.9.0
Then this command:
./configure
Then this
make
I was having this problem even after sudo apt-get install qt5-default (it was already installed).
However the version of QMake I had pointed to was in the Linux Processor SDK (02.00.02.11)
I fixed it by sourcing the environment setup before running qtcreator. The following shell script did it for me:
source /opt/ti/processor-sdk-linux-am335x-evm-02.00.02.11/linux-devkit/environment-setup
# substitute the location where the SDK is installed.
~/Qt5.9.0/Tools/QtCreator/bin/qtcreator -block
# substitute the location where QTCreator is installed

gcc-arm-linux-gnueabi command not found

I am trying to install the gnu arm toolchain for ubuntu. I first downloaded the tar from CodeSourcery. However when I go into the bin folder, I cannot run any of the binaries. I have tried with ./ and without and putting it in the PATH and it keeps telling me "Command not Found" yet the file is there in the folder right in front of me. Then I tried sudo apt-get install gcc-arm-linux-gnueabi except after it says it has installed successfully, I cannot find it with whereis gcc-arm-linux-gnueabi. Can anyone help?
fixed, using:
sudo apt-get install gcc-arm*
Are you compiling on a 64-bit OS? Try:
sudo apt-get install ia32-libs
I had the same problem when trying to compile the Raspberry Pi kernel. I was cross-compiling on Ubuntu 12.04 64-bit and the toolchain requires ia32-libs to work on on a 64-bit system.
See http://hertaville.com/2012/09/28/development-environment-raspberry-pi-cross-compiler/
CodeSourcery convention is to use prefix arm-none-linux-gnueabi- for all executables, not gcc-arm-linux-gnueabi that you mention. So, standard name for CodeSourcery gcc would be arm-none-linux-gnueabi-gcc.
After you have installed CodeSourcery G++, you need to add CodeSourcery directory into your PATH.
Typically, I prefer to install CodeSourcery into directory like /opt/arm-2010q1 or something like that. If you don't know where you have installed it, you can find it using locate arm-none-linux-gnueabi-gcc, however you may need to force to update your locate db using sudo updatedb before locate will work properly.
After you have identified where your CodeSourcery is installed, add it your PATH by editing ~/.bashrc like this:
PATH=/opt/arm-2010q1/bin:$PATH
Also, it is customary and very convenient to define
CROSS_COMPILE=arm-none-linux-gnueabi-
in your .bashrc, because with CROSS_COMPILE defined, most tools will automatically use proper compiler for ARM compilation without you doing anything.
if you are on 64 bit os then you need to install this additional libraries.
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
got the same error when trying to cross compile the raspberry pi kernel on ubunto 14.04.03 64bit under VM. the solution was found here:
-Install packages used for cross compiling on the Ubuntu box.
sudo apt-get install gcc-arm-linux-gnueabi make git-core ncurses-dev
-Download the toolchain
cd ~
git clone https://github.com/raspberrypi/tools
-Add the toolchain to your path
PATH=$PATH:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian:~/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin
notice the x64 version in the path command
I was also facing the same issue and resolved it after installing the following dependency:
sudo apt-get install lib32z1-dev
If you are on a 64bit build of ubuntu or debian (see e.g. 'cat /proc/version') you should simply use the 64bit cross compilers, if you cloned
git clone https://github.com/raspberrypi/tools
then the 64bit tools are in
tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64
use that directory for the gcc-toolchain.
A useful tutorial for compiling that I followed is available here Building and compiling Raspberry PI Kernel (use the -x64 path from above as ${CCPREFIX})
You have installed a toolchain which was compiled for i686 on a box which is running an x86_64 userland.
Use an i686 VM.
Its a bit counter-intuitive. The toolchain is called gcc-arm-linux-gnueabi. To invoke the tools execute the following: arm-linux-gnueabi-xxx
where xxx is gcc or ar or ld, etc
try the following command:
which gcc-arm-linux-gnueabi
Its very likely the command is installed in /usr/bin.
I had to cross compile C code in Ubuntu for ARM. This worked for me:
$ sudo apt install gcc-arm-none-eabi
Later, tested it on the qemu emulator
#Install qemu
sudo apt-get install qemu qemu-user-static qemu-system-arm
#Cross compile "helloworld.c"
$ arm-none-eabi-gcc --specs=rdimon.specs -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group helloworld.c -o helloworld
#Run
qemu-arm-static helloworld

/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

Error message when setting up ADT in Linux

I installed Ubuntu 11.10, installed GNOME 3 (replaced Unity), installed Eclipse from the Ubuntu Software Center, installed the android sdk and ADT.
Now when I start eclipse I get a message saying:
Failed to get ADB version : Cannot run program
/home/ayush/android-sdk/platform-tools/adb":java.io.IOException:error=2,
No such file or directory
What is causing this error and how do I fix it?
The command to install IA32 libraries on Ubuntu is:
apt-get install ia32-libs
sudo dpkg --add-architecture i386
sudo apt-get update
apt-get install ia32-libs
Before that please check your ubuntu version. if you are running with 64 bits, you need to install a linux emulator, IA32 bit I thinks. Verify on Google.
after that, your ADB can run easily on ubuntu.
I'm using Fedora 17 and I got the same error as the poster:
[2013-08-29 21:44:08 - adb] Unexpected exception 'Cannot run program
"/home/el/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb":
error=2, No such file or directory' while attempting to get adb version from
'/home/el/adt-bundle-linux-x86_64-20130729/sdk/platform-tools/adb'
I know this works if you are using Fedora 17/18 (login as root)
yum install redhat-lsb.i686
And then restart the IDE and the errors no longer show.
I had the exact same error as you had, but on my Ubuntu 12.04 LTS version.
The following avoided that error for me:
1) Install 'adb' and 'fastboot' provided by the following third-party PPA.
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
2) Replace the copy of 'adb' and 'fastboot' provided by the official Android SDK with those installed from the above step:
cp /usr/bin/adb <path-to-your-adt-sdk-package>/sdk/platform-tools/adb
cp /usr/bin/fastboot <path-to-your-adt-sdk-package>/sdk/platform-tools/fastboot
3) Restart(re-execute) your eclipse binary.
Full credits:
http://www.webupd8.org/2012/08/install-adb-and-fastboot-android-tools.html
They have the binaries for 12.10, 11.10 and 11.04 as well.
Don't try to install ia32-libs, this library has been obsoleted.
So, you should install these libraries:
sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
Cheers

Resources