Linux 加载共享库时出错:libncurses.so.5:

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17005654/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 23:10:18  来源:igfitidea点击:

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

linuxubuntushared-libraries

提问by pawel

I've installed Android Studio and tried to run my first project in it, and I've got following error:

我已经安装了 Android Studio 并尝试在其中运行我的第一个项目,但出现以下错误:

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).

但它没有帮助。我最近安装了 libncurses(在使用 android studio 之前)。

What should I do?

我该怎么办?

采纳答案by Edwin Buck

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.

如果您绝对确定安装了 libncurses,又名 ncurses,就像您成功完成了库的“ls”一样,那么也许您正在运行 64 位 Linux 操作系统并且只安装了 64 位 libncurses,当正在运行的程序 (adb) 是 32 位的。

If so, a 32 bit program can't link to a 64 bit library (and won't located 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).

如果是这样,则 32 位程序无法链接到 64 位库(并且无论如何都不会找到它),因此您可能必须安装 libcurses 或 ncurses(32 位版本)。同样,如果您运行的是 64 位 adb,则您的 ncurses 可能是 32 位(可能但不太可能的情况)。

回答by ashish2py

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

如果未安装 libncurses,则安装它并重试。 sudo apt-get install libncurses5:i386

Also install the collection of libraries by using this command sudo apt-get install ia32-libs

还可以使用此命令安装库集合 sudo apt-get install ia32-libs

回答by Matthias

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

ncurses-compat-libs在 Fedora 24 上安装帮助我解决了这个问题 ( unable to start adb error while loading shared libraries: libncurses.so.5)

回答by Rahmat Aligos

error while loading shared libraries: libncurses.so.5

加载共享库时出错: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:

如果你看到这个,你的发行版可能安装了更新版本的 libncurse。首先找出你的发行版有什么版本的 libncurses:

$ 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:

在本例中,我们处理的是版本 6,因此我们创建了两个符号链接:

$ 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.

在此之后,程序应该可以正常运行。

回答by areiser

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.

您的系统可能没有提供 android studio 使用的版本的 ncurses 库。我的 arch linux 安装只有 ncurses 6,但 android studio 需要版本 5。您可以检查您的发行版是否具有兼容性包,或使用 Rahmat Aligos 建议的解决方案。

回答by Przemys?aw Sajnóg

On Arch, i fix like this:

在 Arch 上,我是这样修复的:

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

回答by Zurab Kargareteli

In Fedora 28 use:

在 Fedora 28 中使用:

sudo dnf install ncurses-compat-libs

回答by SLuck

I solved the issue using

我解决了这个问题

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

on ubunutu 18.10

在 Ubuntu 18.10 上

回答by Pritam Banerjee

For Redhat Linux 8 try this:

对于 Redhat Linux 8,试试这个:

sudo yum install libncurses*

回答by Mixaz

On Arch Linux you can install ncurses5-compat-libsAUR package.

在 Arch Linux 上你可以安装ncurses5-compat-libsAUR 包。

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

仅供参考,Arch Wiki android 页面中提到了它,以防万一您需要 Android Studio 的其他一些依赖项:https: //wiki.archlinux.org/index.php/Android