Error loading shared libraries: libncurses.so.5:

I installed Android Studio and tried to launch my first project, and I have the 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 already tried to run

 sudo ldconfig 

but it doesn’t help. I recently installed libncurses (before using android studio).

What should I do?

+14
source share
10 answers

If you are absolutely sure that libncurses, aka ncurses, is installed, since you made a successful "ls" library, you are probably using a 64-bit Linux operating system and only have 64-bit libncurses installed when the running program (adb) is 32 bit.

If so, the 32-bit program cannot reference the 64-bit library (and will not host it anyway), so you may need to install libcurses or ncurses (the 32-bit version). Similarly, if you use 64-bit adb, your ncurses might be 32 bits (a possible but less likely scenario).

+4
source

If libncurses is not installed, install it and try again. sudo apt-get install libncurses5:i386

Also install the library collection using this command sudo apt-get install ia32-libs

+14
source

when loading shared libraries: libncurses.so.5

If you see this, your distribution may have a newer version of libncurse installed. First find out which version of libncurses your distribution 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 symbolic links:

 $ 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 that, the program should work fine.

+14
source

Your system most likely does not provide the ncurses library in your version of Android. My linux installation linux had only ncurses 6, but Android studio needs version 5. You can check if your distribution has a compatibility package or use the solution suggested by Rahmat Aligos.

+1
source

On Arch, I fix it like this:

 sudo ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.6 
+1
source

Fedora 28 uses:

 sudo dnf install ncurses-compat-libs 
+1
source

I solved the problem with

 ln -s libncursesw.so.5 /lib/x86_64-linux-gnu/libncursesw.so.6 

on ubutu 18.10

+1
source

Installing ncurses-compat-libs on Fedora 24 helped me with this issue ( unable to start adb error while loading shared libraries: libncurses.so.5 )

0
source

For Redhat Linux 8, try this:

 sudo yum install libncurses* 
0
source

On Arch Linux, you can install the AUR package for ncurses5-compat-libs .

For your information, this is mentioned on the Android Arch Wiki page, in case you need other dependencies for Android Studio: https://wiki.archlinux.org/index.php/Android

0
source

Source: https://habr.com/ru/post/946875/


All Articles