“libstdc++.so.6:无法打开共享对象文件:没有这样的文件或目录”

Usa*_*mbo 11 apt software-installation

我根据这个问题中的信息与程序搏斗。现在它已安装,但我不知道如何运行它。运行相同版本 Ubuntu 的朋友在以相同方式安装后启动它没有问题。

这就是我所做的:

$ ./Psychonauts
./Psychonauts: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

所以我继续说:

$ sudo apt-get install libstdc++.so.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libstdc++.so.6
E: Couldn't find any package by regex 'libstdc++.so.6'
Run Code Online (Sandbox Code Playgroud)

需要注意的是,我几天前才开始使用 Linux。

好的,所以我确实设法安装了 apt-file 和 apt-file update。

然而,我们又遇到了另一个障碍。

usagiyojimbo@Usagi:~$ sudo apt-file find libstdc++.so.6
[sudo] password for usagiyojimbo: 
E: The cache is empty. You need to run 'apt-file update' first.
Run Code Online (Sandbox Code Playgroud)

我已经这样做了,当我这样做时说:

File is up-to-date.
Ignoring source without Contents File:
a link they won't let me post
Run Code Online (Sandbox Code Playgroud)

或者

File is up-to-date.
Downloading Index a link
No Index available.
Downloading complete file a link
Run Code Online (Sandbox Code Playgroud)

当我尝试运行 Psychonauts 时,我仍然遇到同样的错误。

BuZ*_*dEE 22

您收到错误消息:

E: Unable to locate package libstdc++.so.6
E: Couldn't find any package by regex 'libstdc++.so.6'
Run Code Online (Sandbox Code Playgroud)

因为您尝试安装无法安装的文件libstdc++.so.6,因为它位于 debian 软件包中。

您可以使用apt-file搜索包含该文件的包。要安装它,请键入:

sudo apt-get install apt-file
Run Code Online (Sandbox Code Playgroud)

然后你必须更新索引。

sudo apt-file update
Run Code Online (Sandbox Code Playgroud)

之后,您可以搜索包含该文件的包libstdc++.so.6

sudo apt-file find libstdc++.so.6
Run Code Online (Sandbox Code Playgroud)

然后你会发现很多包含搜索文件的包。在您的情况下,正确的包是libstdc++6

libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Run Code Online (Sandbox Code Playgroud)

然后你可以安装所需的包:

sudo apt-get install libstdc++6
Run Code Online (Sandbox Code Playgroud)

  • 不确定我做了什么不同的事情,但是这次 apt-file find 起作用了。我得到了包列表。当我尝试安装时,它说 libstdc++6 已经是最新版本。当我尝试 ./Psychonauts 时,它仍然说没有这样的文件或目录。 (2认同)

jhi*_*mer 9

我认为 Psychonauts 是一个 32 位应用程序。您将需要安装:

apt-get install lib32stdc++6
Run Code Online (Sandbox Code Playgroud)


Bra*_*iam 3

你已经快完成了,只是使用了比你需要的更多的字符:

sudo apt-get install libstdc++6
Run Code Online (Sandbox Code Playgroud)

...应该可以解决问题。