简体   繁体   English

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

[英]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:我已经安装了 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?我该怎么办?

If libncurses is not installed then install it and try again.如果未安装 libncurses,则安装它并重试。

for 32-bit binaries : sudo apt-get install libncurses5:i386对于 32 位二进制文​​件: sudo apt-get install libncurses5:i386

for 64-bit binaries : sudo apt-get install libncurses5对于 64 位二进制文​​件: 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加载共享库时出错:libncurses.so.5

If you see this, your distro probably has a newer version of libncurse installed.如果你看到这个,你的发行版可能安装了更新版本的 libncurse。 First find out what version of libncurses your distro has:首先找出你的发行版有什么版本的 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.在此之后,程序应该可以正常运行。

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).如果是这样,则 32 位程序无法链接到 64 位库(并且无论如何都不会找到它),因此您可能必须安装 libcurses 或 ncurses(32 位版本)。 Likewise, if you are running a 64 bit adb, perhaps your ncurses is 32 bit (a possible but less likely scenario).同样,如果您运行的是 64 位 adb,则您的 ncurses 可能是 32 位(可能但不太可能的情况)。

On Arch Linux you can install ncurses5-compat-libs AUR package.在 Arch Linux 上,你可以安装ncurses5-compat-libs AUR 包。

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

对于 Redhat Linux 8,试试这个:

sudo yum install libncurses*

在 Fedora 28 中使用:

sudo dnf install ncurses-compat-libs

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

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

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 上

在 Fedora 24 上安装ncurses-compat-libs帮助我解决了这个问题( 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.您的系统可能没有提供 android studio 使用的版本的 ncurses 库。 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.我的 arch linux 安装只有 ncurses 6,但 android studio 需要版本 5。您可以检查您的发行版是否具有兼容性包,或使用 Rahmat Aligos 建议的解决方案。

Mixaz's above answer worked for me. Mixaz的上述答案对我有用。 However I had issues installing the package because of PGP check failures.但是,由于 PGP 检查失败,我在安装软件包时遇到了问题。 Installing it by skipping the signature worked, you could try this :通过跳过签名来安装它,你可以试试这个:

yaourt --m-arg "--skipchecksums --skippgpcheck" -Sb <your-package>

For Redhat Linux this helped,对于 Redhat Linux,这有帮助,

sudo yum install ncurses-compat-libs须藤 yum 安装 ncurses-compat-libs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM